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

做服饰的有哪些网站免费自动生成小程序

做服饰的有哪些网站,免费自动生成小程序,郴州公司做网站,南京网站搭建公司基础配置看我的mmsegmentation。 也可以参考b站 #xff1a;https://www.bilibili.com/video/BV1xA4m1c7H8/?vd_source701421543dabde010814d3f9ea6917f6#reply248829735200 这里面最大的坑就是配置coco数据集。我一般是用yolo#xff0c;这个yolo转coco格式很难搞定#…基础配置看我的mmsegmentation。 也可以参考b站 https://www.bilibili.com/video/BV1xA4m1c7H8/?vd_source701421543dabde010814d3f9ea6917f6#reply248829735200 这里面最大的坑就是配置coco数据集。我一般是用yolo这个yolo转coco格式很难搞定mmdection需要 coco格式的 下面展示一些 内联代码片。 import os import json from PIL import Image# 你的路径定义 coco_format_save_path rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co yolo_format_annotation_path rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\labels\test img_pathDir rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\images\test# 类别映射和其他初始化代码 该代码相对于其他版本用户可以自定义在以下修改类别而不需要额外调用外部文件 categories_mapping [0,] categories [{id: i 1, name: label, supercategory: None} for i, label in enumerate(categories_mapping)]write_json_context {info: {description: , url: , version: , year: 2024, contributor: ,date_created: 2024-02-16},licenses: [{id: 1, name: 0, url: None}],categories: categories,images: [],annotations: [] }imageFileList os.listdir(img_pathDir) for i, imageFile in enumerate(imageFileList):imagePath os.path.join(img_pathDir, imageFile)image Image.open(imagePath)W, H image.sizeimg_context {file_name: imageFile, height: H, width: W,date_captured: 2021-07-25, id: i,license: 1, color_url: , flickr_url: }write_json_context[images].append(img_context)txtFile os.path.splitext(imageFile)[0] .txt # 修改以正确处理文件名 获取该图片获取的txt文件 # 和其他人写的代码区别是可以保证文件被找到with open(os.path.join(yolo_format_annotation_path, txtFile), r) as fr:lines fr.readlines() # 读取txt文件的每一行数据lines是一个列表包含了一个图片的所有标注信息# 重新引入循环中的enumerate函数for j, line in enumerate(lines): # 这里使用enumerate确保j被正确定义parts line.strip().split( )if len(parts) 5: # 确保至少有5个部分 # 这里需要注意yolo格式添加额外的内容容易报错所以需要你只要前面的主要信息class_id, x, y, w, h map(float, parts[:5]) # 只读取前五个值xmin (x - w / 2) * W # 坐标转换ymin (y - h / 2) * Hxmax (x w / 2) * Wymax (y h / 2) * Hbbox_width, bbox_height w * W, h * Hbbox_dict {id: i * 10000 j, # 使用j它现在被enumerate定义image_id: i,category_id: class_id 1, # 注意目标类别要加一iscrowd: 0,area: bbox_width * bbox_height,bbox: [xmin, ymin, bbox_width, bbox_height],segmentation: [[xmin, ymin, xmax, ymin, xmax, ymax, xmin, ymax]]}write_json_context[annotations].append(bbox_dict) name os.path.join(coco_format_save_path, test.json) #这里改一下是train就train.jsonval就val.json with open(name, w) as fw:json.dump(write_json_context, fw, indent2) 配置环境时候一定cd到mmdection文件夹下 pip install -v -e .我创建的是configs/tood下面的。 mytood继承 base ‘./tood_r50_fpn_1x_coco.py’ 按需配置即可需要就配置不需要自己会继承的 _base_ ./tood_r50_fpn_1x_coco.py model dict(bbox_headdict(num_classes1, #这里要改你识别的类别是几个也就是yolo文件里的class。txt 文件中类别数量),) data_root r metainfo {classes: (0,), #这里就是你数据集打的标签palette: [(220, 20, 60), #这是边框的颜色] } train_dataloader dict(batch_size1,datasetdict(data_rootdata_root,metainfometainfo,ann_filerC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\train.json, #coco的json文件data_prefixdict(imgrC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\images\train))) #训练集图片的地址 val_dataloader dict(datasetdict(data_rootdata_root,metainfometainfo,ann_filerC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\val.json,data_prefixdict(imgrC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\images\val))) test_dataloader dict(datasetdict(data_rootdata_root,metainfometainfo,ann_filerC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\test.json,data_prefixdict(imgrC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\images\test)))# 修改评价指标相关配置 val_evaluator dict(ann_filedata_root rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\co\test.json) test_evaluator val_evaluator load_fromrC:\Users\ZhuanZ\Desktop\tood_r50_fpn_1x_coco_20211210_103425-20e20746.pth #基层类的权重文件官网可以下载 default_hooks dict( #这几个钩子文件是在mmdetection-main/configs/_base_/default_runtime.py这里配置的具体要什么gpt搜一下代码功能按需配置即可。timerdict(typeIterTimerHook),# loggerdict(typeLoggerHook, interval50),param_schedulerdict(typeParamSchedulerHook),checkpointdict(typeCheckpointHook, interval1),sampler_seeddict(typeDistSamplerSeedHook),visualizationdict(typeDetVisualizationHook))然后train.py配置 形参指向mytood也就是我们自己配置的数据集。 train玩之后会在mmdetection-main/tools/work_dirs/mytood/epoch_12.pth出现pth目前我还不知道如何保存最优权重这个权重就是咱们训练好的模型。 然后预测用jupter网络编译器运行。 from mmdet.apis import DetInferencer# Choose to use a config model_name rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\configs\tood\mytood.py # Setup a checkpoint file to load checkpoint rC:\Users\ZhuanZ\Desktop\mmdetection-main\mmdetection-main\tools\work_dirs\mytood\epoch_12.pth# Set the device to be used for evaluation device cuda:0# Initialize the DetInferencer inferencer DetInferencer(model_name, checkpoint, device)# Use the detector to do inference img rC:\Users\ZhuanZ\Desktop\1d0d5b0ea6d1c165d471d7365686be4.jpg result inferencer(img, out_dir./output)执行即可预测
http://www.w-s-a.com/news/975801/

相关文章:

  • 岳麓区专业的建设网站公司尚一网常德论坛
  • 电商网站建设实训报告360站长平台链接提交
  • 个性化网站建设公司个人网站备案类型
  • 腾讯建站模板上海网站开发有限公司
  • 网站和小程序的区别请问做网站怎么赚钱
  • 网站logo设计免费版在线网站开发建设准备工作
  • wordpress多站点 主题南京做网站好的公司
  • 广州 门户seo到底是做什么的
  • 可以登录国外网站吗如何用家用电脑做网站
  • 吉安建站公司wordpress企业
  • 河北住房和城乡建设厅网站6thinkphp做视频网站
  • 遵义网站制作一般需要多少钱深圳全国网站制作哪个好
  • 公众平台网站价格哪个网站做餐饮推广最好
  • 深圳 公司网站设计重庆的网站设计公司价格
  • 网站开发市场分析餐饮平台app有哪些
  • 制作一个收费网站要多少钱开发网站需要什么技术
  • 网站流量统计平台二手域名做网站不收录
  • 蒙古网站后缀mysql8.0 wordpress
  • 免费建立一个网站互联网推广培训
  • WordPress多站点绑定域名深圳住房建设部官方网站
  • 网站建设公司zgkr上海网页网络技术有限公司
  • wordpress附件扩展格式徐州seo关键词
  • wordpress博客站模板织梦网站 联系方式修改
  • 北京城乡建设厅网站重庆网站建设解决方案
  • 网站建设和维护工作内容网站的空间与域名
  • 济南做门户网站开发公司网页发布的步骤
  • 江苏省交通厅门户网站建设管理办法做的网站怎么让百度收录
  • 关于怎么做网站网站site的收录数量要多远索引量
  • 传世网站建设阳光创信-网站建设首选品牌
  • 周口建设网站中国装修公司十大排名