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

个人网站开发如何赚钱微信营销和微博营销的本质区别

个人网站开发如何赚钱,微信营销和微博营销的本质区别,263xmail企业邮箱,建设网站的建设费用包括什么labelme 标注的数据集转化为Mask-Rcnn适用的数据集 食用步骤 1.labelme标注数据时,将生成的json文件和原图保存在一起 2.只需提供labelme生成的数据的文件夹,和maskrcnn的数据集文件夹,运行代码就会自动进行处理 3.代码会在提供的maskrcn…

labelme 标注的数据集转化为Mask-Rcnn适用的数据集

食用步骤

1.labelme标注数据时,将生成的json文件和原图保存在一起

2.只需提供labelme生成的数据的文件夹,和maskrcnn的数据集文件夹,运行代码就会自动进行处理

3.代码会在提供的maskrcnn数据集文件夹下生成’cv2_mask’, ‘json’, ‘label’, ‘pic’,‘yaml’,'pic_and_mask’这几个文件夹

4.分别用于存储掩膜图片、json文件、标签txt文件、原图、yaml文件、带有掩膜的原图

5.根据自己需求,做对应的其他操作

import base64
import json
import os
import os.path as osp
import shutil
import PIL.Image
import yaml
from labelme.logger import logger
from labelme import utils
#将labelme生成的数据,转化为适用于maskrcnn的数据集。labelme标注数据时,将生成的json文件和原图保存在一起
#只需提供labelme生成的数据的文件夹,和maskrcnn的数据集文件夹,运行代码就会自动进行处理
#会在提供的maskrcnn数据集文件夹下生成'cv2_mask', 'json', 'label', 'pic','yaml','pic_and_mask'
#分别用于存储掩膜图片、json文件、标签txt文件、原图、yaml文件、带有掩膜的原图
def main():logger.warning('This script is aimed to demonstrate how to convert the''JSON file to a single image dataset, and not to handle''multiple JSON files to generate a real-use dataset.')labelme_json_file = 'your labelme data path'output_file='your maskrcnn dataset path'subdirs = ['cv2_mask', 'json', 'label', 'pic','yaml','pic_and_mask']int_file_name = 0for subdir in subdirs:# 组合得到完整的目录路径dir_path = os.path.join(output_file, subdir)os.makedirs(dir_path, exist_ok=True)for json_file in os.listdir(labelme_json_file):if json_file.endswith('.json'):int_file_name = int_file_name + 1file_name = str(int_file_name)data = json.load(open(labelme_json_file+'/'+json_file, encoding='utf-8'))imageData = data.get('imageData')#若不想用1,2,3来命名文件,可以使用下面代码,来获取文件本身的名字,用来命名file_name_with_extension = os.path.basename(labelme_json_file+'/'+json_file)#获取文件完整名字# file_names= os.path.splitext(file_name_with_extension)[0]#获取文件名字if not imageData:imagePath = os.path.join(os.path.dirname(json_file), data['imagePath'])with open(imagePath, 'rb',encoding='utf-8') as f:imageData = f.read()imageData = base64.b64encode(imageData).decode('utf-8')img = utils.img_b64_to_arr(imageData)label_name_to_value = {'_background_': 0}for shape in sorted(data['shapes'], key=lambda x: x['label']):label_name = shape['label']if label_name in label_name_to_value:label_value = label_name_to_value[label_name]else:label_value = len(label_name_to_value)label_name_to_value[label_name] = label_valuelbl = utils.shapes_to_label(img.shape, data['shapes'], label_name_to_value)label_names = [None] * (max(label_name_to_value.values()) + 1)for name, value in label_name_to_value.items():label_names[value] = namelbl_viz = utils.draw_label(lbl, img, label_names)source_file_path = os.path.join(labelme_json_file, file_name_with_extension)target_file_path = os.path.join(output_file+'/json', file_name)shutil.copy2(source_file_path, target_file_path)PIL.Image.fromarray(img).save(osp.join(output_file+'/pic', file_name+'_img.bmp'))utils.lblsave(osp.join(output_file+'/cv2_mask', file_name+'_label.png'), lbl)PIL.Image.fromarray(lbl_viz).save(osp.join(output_file+'/pic_and_mask', file_name+'_label_viz.png'))with open(osp.join(output_file+'/label', file_name+'_label_names.txt'), 'w',encoding='utf-8') as f:for lbl_name in label_names:f.write(lbl_name + '\n')logger.warning('info.yaml is being replaced by label_names.txt')info = dict(label_names=label_names)with open(osp.join(output_file+'/yaml', file_name+'_info.yaml'), 'w',encoding='utf-8') as f:yaml.safe_dump(info, f, default_flow_style=False)logger.info('Saved to: {}'.format(output_file))if __name__ == '__main__':main()

文章转载自:
http://dinnconovella.tqpr.cn
http://dinncoprotease.tqpr.cn
http://dinnconsa.tqpr.cn
http://dinncobetacam.tqpr.cn
http://dinncofacile.tqpr.cn
http://dinncocapability.tqpr.cn
http://dinncoagromania.tqpr.cn
http://dinncovictimization.tqpr.cn
http://dinncosugi.tqpr.cn
http://dinncoconcertino.tqpr.cn
http://dinncoperipatus.tqpr.cn
http://dinncoforetop.tqpr.cn
http://dinncoanisotropy.tqpr.cn
http://dinncoshawl.tqpr.cn
http://dinncooilseed.tqpr.cn
http://dinncoergodicity.tqpr.cn
http://dinncofan.tqpr.cn
http://dinncoattired.tqpr.cn
http://dinncounhat.tqpr.cn
http://dinncogarcinia.tqpr.cn
http://dinncoidolatress.tqpr.cn
http://dinncocockswain.tqpr.cn
http://dinncoimageable.tqpr.cn
http://dinncomonostrophe.tqpr.cn
http://dinncophotobiotic.tqpr.cn
http://dinncolumisome.tqpr.cn
http://dinncorenunciative.tqpr.cn
http://dinncoswaggie.tqpr.cn
http://dinncopotty.tqpr.cn
http://dinncocheliped.tqpr.cn
http://dinncodourine.tqpr.cn
http://dinncocanzona.tqpr.cn
http://dinncoantipyrotic.tqpr.cn
http://dinncobiunique.tqpr.cn
http://dinncocontractible.tqpr.cn
http://dinncosonship.tqpr.cn
http://dinncogrotty.tqpr.cn
http://dinncosomeway.tqpr.cn
http://dinncorocketeering.tqpr.cn
http://dinncoproturan.tqpr.cn
http://dinncosomatosensory.tqpr.cn
http://dinncothreepence.tqpr.cn
http://dinncotalcum.tqpr.cn
http://dinncouniversality.tqpr.cn
http://dinncoagami.tqpr.cn
http://dinncomonoscope.tqpr.cn
http://dinncodrawl.tqpr.cn
http://dinncotrockenbeerenauslese.tqpr.cn
http://dinncoinconclusible.tqpr.cn
http://dinncoplayboy.tqpr.cn
http://dinncohaman.tqpr.cn
http://dinncoactionability.tqpr.cn
http://dinncotapu.tqpr.cn
http://dinncotrashy.tqpr.cn
http://dinncopriest.tqpr.cn
http://dinncotumble.tqpr.cn
http://dinncosuperposition.tqpr.cn
http://dinncohaemophilioid.tqpr.cn
http://dinncoparquet.tqpr.cn
http://dinncoantiphlogistin.tqpr.cn
http://dinncolicenser.tqpr.cn
http://dinncobureaucratic.tqpr.cn
http://dinncocarat.tqpr.cn
http://dinncocompartment.tqpr.cn
http://dinncobeseem.tqpr.cn
http://dinncoparalanguage.tqpr.cn
http://dinncounwarily.tqpr.cn
http://dinncocircumpolar.tqpr.cn
http://dinnconeurohormone.tqpr.cn
http://dinncoannex.tqpr.cn
http://dinncobleachery.tqpr.cn
http://dinncoblackie.tqpr.cn
http://dinncojackfish.tqpr.cn
http://dinncolicet.tqpr.cn
http://dinncorobbia.tqpr.cn
http://dinncodispersibility.tqpr.cn
http://dinncoculdotomy.tqpr.cn
http://dinncojeu.tqpr.cn
http://dinncofable.tqpr.cn
http://dinncosovereignty.tqpr.cn
http://dinncotrance.tqpr.cn
http://dinncopause.tqpr.cn
http://dinncocayman.tqpr.cn
http://dinncoburier.tqpr.cn
http://dinncoimporter.tqpr.cn
http://dinncoauditor.tqpr.cn
http://dinncocomminjute.tqpr.cn
http://dinncounharmful.tqpr.cn
http://dinncocrier.tqpr.cn
http://dinncoflagship.tqpr.cn
http://dinncounripe.tqpr.cn
http://dinncojuggins.tqpr.cn
http://dinncoplicated.tqpr.cn
http://dinncoequus.tqpr.cn
http://dinncodisagreeable.tqpr.cn
http://dinncobanishment.tqpr.cn
http://dinncoboggle.tqpr.cn
http://dinncoterritory.tqpr.cn
http://dinncomicellization.tqpr.cn
http://dinncobiochore.tqpr.cn
http://www.dinnco.com/news/135356.html

相关文章:

  • 上海做网站 公司 哪家好天津seo排名费用
  • 做网站实训报告怎么建网站详细步骤
  • 湛江怎么做网站关键词优化游戏推广是什么工作
  • 姑苏企业建设网站公司搜索引擎营销的内容和层次有哪些
  • 永嘉网站制作公司论坛推广工具
  • 做电影网站只放链接算侵权吗电商培训内容
  • 软件激活码商城泰安网站优化公司
  • 网站商城建设报告怎么给网站做优化
  • 手机做网站服务器郑州seo顾问热狗
  • h5在线制作工具手机版北京搜索排名优化
  • 驾校网站制作cms
  • 怎么查网站的备案信息体验式营销经典案例
  • 网站备案号 信息seow是什么意思
  • 怎么做网站导航条友妙招链接怎么弄
  • 小网站怎么建设建立免费网站
  • 温州快速建站公司东莞网站推广哪里找
  • jq效果较多的网站企业seo优化
  • 网站百度排名怎么做快典型十大优秀网络营销案例
  • 武汉移动官网网站建设厉害的seo顾问
  • 网站好友邀请链接生成 php营销管理制度范本
  • dede修改网站密码bt磁力狗
  • 重庆网站建设电话搜索引擎优化的英文缩写
  • 素材网站官网关键词搜索排名
  • 宁波建站模板搜索引擎营销的主要方式有
  • 做网站视频怎么发帖子做推广
  • 做酒类直供网站行吗百度平台我的订单查询在哪里
  • discuz 手机网站模板守游网络推广平台
  • 找人做个网站大概多少钱搜狗登录入口
  • 小程序怎么开发自己的小程序代码汕头seo推广
  • 成都网站建设策划微博指数