当前位置: 首页 > news >正文

郑州网站app开发wordpress和python

郑州网站app开发,wordpress和python,网站免费的,重庆传媒公司前十名二、VOC可视化数据集 1、作用 在做目标检测时#xff0c;首先要检查标注数据。一方面是要了解标注的情况#xff0c;另一方面是检查数据集的标注和格式是否正确#xff0c;只有正确的情况下才能进行下一步的训练。 2、代码实现 import os # import sys import cv2 import… 二、VOC可视化数据集 1、作用 在做目标检测时首先要检查标注数据。一方面是要了解标注的情况另一方面是检查数据集的标注和格式是否正确只有正确的情况下才能进行下一步的训练。 2、代码实现 import os # import sys import cv2 import random from tqdm import tqdm # import numpy as np import argparse import xml.etree.ElementTree as ETdef xml_reader(filename): Parse a PASCAL VOC xml file tree ET.parse(filename)objects []for obj in tree.findall(object):obj_struct {}obj_struct[name] obj.find(name).textbbox obj.find(bndbox)obj_struct[bbox] [int(bbox.find(xmin).text),int(bbox.find(ymin).text),int(bbox.find(xmax).text),int(bbox.find(ymax).text)]objects.append(obj_struct)return objectsdef get_image_list(image_dir, suffix[jpg, png]):get all image path ends with suffixif not os.path.exists(image_dir):print(PATH:%s not exists % image_dir)return []imglist []for root, sdirs, files in os.walk(image_dir):if not files:continuefor filename in files:filepath os.path.join(root, filename)if filename.split(.)[-1] in suffix:imglist.append(filepath)return imglistif __name__ __main__:parser argparse.ArgumentParser(descriptioncheck data)parser.add_argument(--input, destinput, helpThe input dir of images, typestr)parser.add_argument(--output, destoutput, defaulttemp, helpThe output dir of images, typestr)parser.add_argument(--num, destnum, default50, helpThe number of images you want to check, typeint)args parser.parse_args()if not os.path.exists(args.output):os.makedirs(args.output)img_list get_image_list(args.input)img_list random.sample(img_list, args.num)for img_path in tqdm(img_list):img cv2.imread(img_path)if img is None or not img.any():continuexml_path img_path.replace(JPEGImages, Annotations).replace(.jpg, .xml).replace(.png, .xml)objects xml_reader(xml_path)if len(objects) 0:continue# draw box and namefor obj in objects:name obj[name]box obj[bbox]p1 (box[0], box[1])p2 (box[2], box[3])p3 (max(box[0], 15), max(box[1], 15))cv2.rectangle(img, p1, p2, (0, 0, 255), 2)cv2.putText(img, name, p3, cv2.FONT_ITALIC, 1, (0, 255, 0), 2)img_name os.path.basename(img_path)cv2.imwrite(os.path.join(args.output, img_name), img) 3、使用方法 python Visual_dataset.py --input VOCdevkit/JPEGImages --output ./Result_imgs --num 3408python 上述代码的文件名称 --input 图片地址 --output 输出文件夹地址 --num 图片数量4、常见报错 (python38) D:\pythontorch\VOCpython Visual_dataset.py --input VOCdevkit/ImageSets --output Result_imgs --num 3408 Traceback (most recent call last):   File Visual_dataset.py, line 55, in module     img_list random.sample(img_list, args.num)   File C:\ProgramData\Anaconda3\envs\python38\lib\random.py, line 363, in sample     raise ValueError(Sample larger than population or is negative) ValueError: Sample larger than population or is negative 原因 你的路径写错了
http://www.pierceye.com/news/535019/

相关文章:

  • 为企业做网站策划案永康网站推广
  • 做个企业网网站怎么做linux建网站
  • 专业建站公司主要做什么wordpress加入下载标签
  • 韩都衣舍网站建设方案美食网站怎么做dw
  • 电商网站开发 参考文献wordpress验证码注册
  • ic外贸网站建设wordpress和shopex
  • 网站技术制作流程图国内顶尖小程序开发公司
  • 免费网站建设下载优化关键词规则
  • 网站浮动窗口如何做自己怎么做淘宝客网站
  • 石材外贸在哪个网站做网页版 微信
  • 网站开发属于程序员吗sem 优化软件
  • 公司做网站是管理费用小程序官方文档
  • 公司网站推广技巧响水网站设计
  • 徐州本地网站wap页面是什么
  • 网站开发应用价值做套网站多少钱
  • asp.net网站模板免费下载怎么才能访问自己做的网站
  • 长沙企业网站制作宝安公司网站建设
  • 做网站需要拉多大的宽带dw做的网站怎么做后台
  • 公司网站建设设计公司哪家好wordpress自动封ip
  • 郫县网站制作wordpress搜索打钩
  • 哪些网站可以做招商广告语wordpress发文章的id怎么不连续
  • 家私网站栏目和功能需求策划网页样式库
  • 什么是网站网页主页企业电子邮箱格式
  • 金属建材企业网站建设方案用pycharm做网站
  • 重庆网站空间黄骅港一期码头潮汐表
  • 推广网站如何做做酒店网站所用到的算法
  • 最好的网站建设组织wordpress 删除google
  • 生物科技 网站模板下载在线室内设计
  • 网站兼容性问题线上设计师接单
  • 外包网站平台可以做电算化的网站