1 Star 0 Fork 1

madobet/yolov4-tf2

forked from Ole168/yolov4-tf2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
predict.py 547 Bytes
一键复制 编辑 原始数据 按行查看 历史
madobet 提交于 2020-07-14 15:36 . Merged modification by king
from yolo import YOLO
from PIL import Image
import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
yolo = YOLO()
while True:
img = input('Input image filename:')
# img = 'img/street.jpg'
try:
image = Image.open(img)
except:
print('Open Error! Try again!')
continue
else:
r_image = yolo.detect_image(image)
r_image.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/madobet/yolov4-tf2.git
git@gitee.com:madobet/yolov4-tf2.git
madobet
yolov4-tf2
yolov4-tf2
master

搜索帮助