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

柳州网站建设找哪家好苏州北京网站建设

柳州网站建设找哪家好,苏州北京网站建设,wordpress主题less,成免费的crm无需下载主要是查到的可用代码#xff0c;便于自己使用查询#xff0c;和有相关需求的提供参考。 代码是MMYOLO下的可视化代码browse_coco_json.py#xff0c;有json文件和图像文件#xff0c;可以直接输入执行#xff0c;输出会把bbox、mask等类型标注展示。 下面直接上代码便于自己使用查询和有相关需求的提供参考。 代码是MMYOLO下的可视化代码browse_coco_json.py有json文件和图像文件可以直接输入执行输出会把bbox、mask等类型标注展示。 下面直接上代码 import argparse import os.path as ospimport cv2 import matplotlib.pyplot as plt import numpy as np from matplotlib.collections import PatchCollection from matplotlib.patches import Polygon from pycocotools.coco import COCOdef show_coco_json(args):if args.data_root is not None:coco COCO(osp.join(args.data_root, args.ann_file))else:coco COCO(args.ann_file)print(fTotal number of images{len(coco.getImgIds())})categories coco.loadCats(coco.getCatIds())category_names [category[name] for category in categories]print(fTotal number of Categories : {len(category_names)})print(Categories: \n{}\n.format( .join(category_names)))if args.category_names is None:category_ids []else:assert set(category_names) set(args.category_names)category_ids coco.getCatIds(args.category_names)image_ids coco.getImgIds(catIdscategory_ids)if args.shuffle:np.random.shuffle(image_ids)for i in range(len(image_ids)):image_data coco.loadImgs(image_ids[i])[0]if args.data_root is not None:image_path osp.join(args.data_root, args.img_dir,image_data[file_name])else:image_path osp.join(args.img_dir, image_data[file_name])annotation_ids coco.getAnnIds(imgIdsimage_data[id], catIdscategory_ids, iscrowd0)annotations coco.loadAnns(annotation_ids)image cv2.imread(image_path)image cv2.cvtColor(image, cv2.COLOR_BGR2RGB)plt.figure()plt.imshow(image)if args.disp_all:coco.showAnns(annotations)else:show_bbox_only(coco, annotations)if args.wait_time 0:plt.show()else:plt.show(blockFalse)plt.pause(args.wait_time)plt.close()def show_bbox_only(coco, anns, show_label_bboxTrue, is_fillingTrue):Show bounding box of annotations Only.if len(anns) 0:returnax plt.gca()ax.set_autoscale_on(False)image2color dict()for cat in coco.getCatIds():image2color[cat] (np.random.random((1, 3)) * 0.7 0.3).tolist()[0]polygons []colors []for ann in anns:color image2color[ann[category_id]]bbox_x, bbox_y, bbox_w, bbox_h ann[bbox]poly [[bbox_x, bbox_y], [bbox_x, bbox_y bbox_h],[bbox_x bbox_w, bbox_y bbox_h], [bbox_x bbox_w, bbox_y]]polygons.append(Polygon(np.array(poly).reshape((4, 2))))colors.append(color)if show_label_bbox:label_bbox dict(facecolorcolor)else:label_bbox Noneax.text(bbox_x,bbox_y,%s % (coco.loadCats(ann[category_id])[0][name]),colorwhite,bboxlabel_bbox)if is_filling:p PatchCollection(polygons, facecolorcolors, linewidths0, alpha0.4)ax.add_collection(p)p PatchCollection(polygons, facecolornone, edgecolorscolors, linewidths2)ax.add_collection(p)def parse_args():parser argparse.ArgumentParser(descriptionShow coco json file)parser.add_argument(--data-root, defaultNone, helpdataset root)parser.add_argument(--img-dir, defaultdata/coco/train2017, helpimage folder path)parser.add_argument(--ann-file,defaultdata/coco/annotations/instances_train2017.json,helpann file path)parser.add_argument(--wait-time, typefloat, default2, helpthe interval of show (s))parser.add_argument(--disp-all,actionstore_true,helpWhether to display all types of data, such as bbox and mask. Default is to display only bbox)parser.add_argument(--category-names,typestr,defaultNone,nargs,helpDisplay category-specific data, e.g., bicycle, person)parser.add_argument(--shuffle,actionstore_true,helpWhether to display in disorder)args parser.parse_args()return argsdef main():args parse_args()show_coco_json(args)if __name__ __main__:main()用法 –img-dir 图片文件夹 –ann-file coco标签文件 –disp-all 显示所所有类别标签 python browse_coco_json.py --img-dir /dataset/image/coco/train2017 \--ann-file /label/instances_train2017.json \--disp-all查看 COCO 全部类别同时仅展示 bbox 类型的标注并打乱显示 python browse_coco_json.py --data-root ./data/coco \--img-dir train2017 \--ann-file annotations/instances_train2017.json \--shuffle只查看 bicycle 和 person 类别同时仅展示 bbox 类型的标注 python browse_coco_json.py --data-root ./data/coco \--img-dir train2017 \--ann-file annotations/instances_train2017.json \--category-names bicycle person查看 COCO 全部类别同时展示 bbox、mask 等所有类型的标注并打乱显示 python browse_coco_json.py --data-root ./data/coco \--img-dir train2017 \--ann-file annotations/instances_train2017.json \--disp-all \--shuffle
http://www.yutouwan.com/news/90744/

相关文章:

  • wordpress cenosseo去哪里培训
  • asp.net mvc网站开发高端网站建设南宁
  • DW网站建设出现哪些问题电影分享网站源码
  • 网站建设_wordpress 缩略图代码
  • 北京建设执业网站电脑传奇游戏哪个好玩
  • 企业网站推广解决方案海淀做网站设计的公司
  • 网站建设与维护合同范本大数据营销的优缺点
  • 网站建设教程app抖音代运营策划案
  • 企业网站建设设计任务书wordpress 书架
  • 高端网站建设与制作集宁有做蒙古黑石材网站的嘛
  • 易企秀怎么做招聘网站超链接就要外贸人才网论坛
  • 重庆建设网站公司十堰网站制作公司电话
  • 网站建设设猎头公司是什么意思
  • 南京机关建设网站抖音小程序定制
  • 做网站时如何建立栅格工程建筑公司网站
  • 网站的程序和数据库怎么做网站备案免费吗
  • 福州市建设工程造价管理网站三明城乡建设网站
  • 做网站公司哪个比较好jexus wordpress
  • 做网站哪里最好黑龙江域名注册
  • 自己有主机怎么做论坛网站网站被挂黑链怎么删除
  • 机械设备 东莞网站建设会计专业建设规划
  • 基于asp.net电子商务网站开发实践中的关键技术和应用网站模版整站下载
  • 知名跟单网站做信号提供方海南三亚注册公司需要什么条件
  • 四川建设信息共享网站新媒体营销策略都有哪些
  • 廊坊 网站加盟网络营销推广公司
  • 无锡网站建设企业设计网页布局的常用方法有哪三种
  • 企业网站模板素材电子商务公司怎么赚钱
  • 个人网站主机的配置黄页88推广多少钱
  • 南昌建设网站公司物流网络的概念
  • 惠来做网站wordpress js优化