28 Star 128 Fork 25

cungudafa / hand-keras-yolo3-recognize

Clone or download
predict.py
Copy Edit Web IDE Raw Normal History
cungudafa   sign 2020-08-08
#!/usr/bin/env pythonimport osfrom keras.layers import Inputfrom yolo import YOLO, detect_videofrom pose_hand import getImageInfo,getVideoInfofrom PIL import Imageimport matplotlib.pyplot as pltplt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号def main(yolo):    #img_file = 'docs/wangyu_hand_img/job_32.jpg'#'docs/img/write_51.jpg'    #print("[INFO]img_file",img_file)    path= 'D:/myworkspace/dataset/My_test/small_img/67_img/'    outfile = 'D:/myworkspace/dataset/My_test/hand_img/67_img/'#处理完的帧    if not os.path.exists(outfile):          os.makedirs(outfile)    files = [os.path.join(path, file1) for file1 in os.listdir(path)]    # pose    modelpath = "model/"    for img_file in files:        name = os.path.split(img_file)[1]        if name[-4:] == ".png":            r_image,info = getImageInfo(img_file,modelpath)            print(info)            r_image.save(outfile + name[:-4]+".jpg")# 保存            print("成功保存",outfile,name[:-4]+".jpg")    #r_image,info = getImageInfo(img_file,modelpath)    #print("[INFO]Pose[25] and Hands[20]: ", info)    video_name = "docs/write"    #getVideoInfo(modelpath,video_name+".mp4", video_name+"_detect.mp4")if __name__ == '__main__':    _yolo = YOLO()    main(_yolo)
Python
1
https://gitee.com/cungudafa/hand-keras-yolo3-recognize.git
git@gitee.com:cungudafa/hand-keras-yolo3-recognize.git
cungudafa
hand-keras-yolo3-recognize
hand-keras-yolo3-recognize
master

Search

152606 8668e384 1899542 133635 2cd7d36e 1899542