当前位置:网站首页>Label the mask image not obtained through labelme
Label the mask image not obtained through labelme
2022-06-11 07:51:00 【AQ14_】
Existing mask Label image
def mask_label(img_shape,mask,label_name_to_value):
cls = np.zeros(img_shape[:2], dtype=np.int32)
cls_name='module'
cls_id = label_name_to_value[cls_name]
cls[mask] = cls_id
return cls
labelme Drawing included in mask Image code
def shape_to_mask(img_shape, points, shape_type=None,
line_width=10, point_size=5):
mask = np.zeros(img_shape[:2], dtype=np.uint8)
mask = PIL.Image.fromarray(mask)
draw = PIL.ImageDraw.Draw(mask)
xy = [tuple(point) for point in points]
assert len(xy) > 2, 'Polygon must have points more than 2'
draw.polygon(xy=xy, outline=1, fill=1)
mask = np.array(mask, dtype=bool)
return mask
边栏推荐
- 签到体系设计:签到功能该怎么画
- 测试4年裸辞失业,面试15k的测试岗被按在地上摩擦,结局让我崩溃大哭...
- Session and session management technology
- .NET C#基础(6):命名空间 - 有名字的作用域
- Sort - merge sort
- wordcloud的使用
- 零基础自学SQL课程 | OUTER JOIN外连接
- C wechat upload form data
- Detailed explanation of character function and string function (including simulation implementation)
- Switch statement
猜你喜欢

【案例解读】医疗单据OCR识别助力健康险智能理赔

You got 8K in the 3-year function test, but you were actually pretending to work hard

Black Qunhui dsm7.0.1 physical machine installation tutorial

Using Tkinter to realize guessing numbers game

Data visualization and Matplotlib

二本畢業,銀行外包測試工作 4 個月有餘。聊聊一些真實感受 ...

How to output the percent sign "%" in printf function in C language
![[codeforces1019e] raining season](/img/8e/4a96954ee7dae5f81eaae05b5a075b.png)
[codeforces1019e] raining season

批量拼接字符串

图数据库无缝集成Tushare接口
随机推荐
The solution of "no startup device" after running Bochs
欧拉定理及扩展(附证明)
C language Yanghui triangle code
[IOT] project management: how to build a better cross functional team?
Wc2020 guessing game
.NET C#基础(6):命名空间 - 有名字的作用域
Classes and objects (medium)
Image data enhancement (translation, rotation, brightness transformation, flipping, adding Gaussian noise, scaling, cropping)
【案例解读】医疗单据OCR识别助力健康险智能理赔
A detailed explanation of one of the causes of dead loop caused by array out of bounds in C language
Deux diplômés, la Banque a externalisé le travail d'essai pendant plus de quatre mois. Parler de vrais sentiments...
wordcloud的使用
JSP development model
mpi
Uoj 554 [unr 4] challenges Hamilton [find Hamilton path (adjustment method)]
Sort - Swap sort
Paging of the flask page
C language to achieve three piece chess (not artificial mental retardation ha ha ha)
Wc2020 course selection
【集群】LVS+keepalived高可用集群