zoukankan      html  css  js  c++  java
  • 遍历

    import cv2
    # COCO Class names
    #For human pose task We just use "BG" and "person"
    class_names = ['BG', 'person']
    # Load a random image from the images folder
    file_names = next(os.walk(IMAGE_DIR))[2]
    # image = skimage.io.imread(os.path.join(IMAGE_DIR, random.choice(file_names)))

    for root_now,dirs_now,files_1 in os.walk(IMAGE_DIR):
      for file_now in files_1:
        print(os.path.join(root_now,file_now)) #根目录与文件名组合,形成绝对路径。
        image1 = cv2.imread(os.path.join(IMAGE_DIR, file_now))
        image1 = image1[:,:,::-1]
        results = model.detect_keypoint([image1], verbose=1)
        r = results[0] # for one image
        visualize.display_keypoints(image1,r['rois'],r['keypoints'],r['class_ids'],class_names,skeleton = inference_config.LIMBS)

  • 相关阅读:
    闭包问题小总结
    git常用命令总结
    数组对象方法的使用
    JS截取URL参数
    CSS清除浮动&内容居中&文字溢出
    网址大全
    any more
    下载网页视频
    下载无损音乐
    "前端" 宝藏网站
  • 原文地址:https://www.cnblogs.com/herd/p/9641057.html
Copyright © 2011-2022 走看看