proper augmentations. Add 7 more images per 1 image

make dirs if not exists
add visualize
This commit is contained in:
Oleksandr Bezdieniezhnykh
2024-05-28 16:39:38 +03:00
parent 02b45f83d1
commit 34d4fd9623
2 changed files with 70 additions and 14 deletions
+21
View File
@@ -0,0 +1,21 @@
import json
class AnnotationClass:
def __init__(self, id, name, color):
self.id = id
self.name = name
self.color = color
@staticmethod
def read_json():
with open('classes.json', 'r', encoding='utf-8') as f:
j = json.loads(f.read())
return {cl['Id']: AnnotationClass(id=cl['Id'], name=cl['Name'], color=cl['Color']) for cl in j}
@property
def color_tuple(self):
color = self.color[3:]
lv = len(color)
xx = range(0, lv, lv // 3)
return tuple(int(color[i:i + lv // 3], 16) for i in xx)