超简单的页眉页脚设置(摘要、目录页眉不同、页脚页码连续)

您所在的位置:网站首页 页眉首页不同怎么设置 超简单的页眉页脚设置(摘要、目录页眉不同、页脚页码连续)

超简单的页眉页脚设置(摘要、目录页眉不同、页脚页码连续)

2024-01-03 09:30| 来源: 网络整理| 查看: 265

含掩膜mask的单通道灰度图转化为COCO数据集格式标签的json文件(python)

小珑gg22mm: 我觉得把代码改成这样可以解决: def create_sub_masks(mask_image): width, height = mask_image.size # wll - 解决内存报错 memoryErrorUpdate=Image.new('1', (width+2, height+2)) # 初始化按RGB颜色索引的子掩码字典 sub_masks = {} for x in range(width): for y in range(height): # 获取像素的RGB值 pixel = mask_image.getpixel((x, y))[:3] # 如果像素不是黑色的。 if pixel != (0, 0, 0): # 检查我们是否创建了子掩码。 pixel_str = str(pixel) sub_mask = sub_masks.get(pixel_str) if sub_mask is None: #创建一个子掩码(每像素一位)并添加到字典中 #注意:我们在每个方向上添加1个像素的填充 #因为轮廓模块不处理案例 #其中像素流血到图像的边缘 sub_masks[pixel_str] = memoryErrorUpdate # 将像素值设置为1(默认值为0),考虑填充 sub_masks[pixel_str].putpixel((x+1, y+1), 1) # import ipdb;ipdb.set_trace() return sub_masks

含掩膜mask的单通道灰度图转化为COCO数据集格式标签的json文件(python)

小珑gg22mm: 很好,不错有个问题,图片多了大了,报内存errr: 0354dcf9-ff05-11ea-ab75-00163e02df4a.png 55it [1:29:31, 97.67s/it] Traceback (most recent call last): File "mask2poly.py", line 228, in get_annotation(maskimglist) File "mask2poly.py", line 200, in get_annotation sub_masks = create_sub_masks(mask_image) File "mask2poly.py", line 84, in create_sub_masks sub_masks[pixel_str] = Image.new('1', (width+2, height+2)) File "d:\Anaconda3\envs\mygpt\lib\site-packages\PIL\Image.py", line 2932, in new return im._new(core.fill(mode, size, color)) MemoryError

TypeError: ‘float‘ object is not subscriptable 已解决

weixin_41657202: 我遇到的问题及我的理解: 在一个列表中有12个浮点数,我不小心将列表看成列表嵌套列表了,多写了一层索引,于是出现上述报错,即数据不能使用索引(或其不是列表结构,无索引)。 list_1 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0] 使用时不小心写成了list_1[0][0]了,一步步进行就成了1.0[0],于是报错。纠正索引即可。

含掩膜mask的单通道灰度图转化为COCO数据集格式标签的json文件(python)

小珑gg22mm: 看样子非常不错,这样的话很多蒙版图就可直接转成coco了~~

YOLOv5(v7.0)网络修改实践三:把单分支anchor-based、head改为yolov8的anchor-free、双分支解耦合head(yolox的DecoupleHead)

fanfou_: 博主,想要学习下yolov5 anchor-free部分的代码实现,可以分享一下代码吗表情包(私聊发现陌生人发不了消息)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3