scribble-annotation-generator 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scribble_annotation_generator/gmm_random_generator.py +5 -3
- {scribble_annotation_generator-0.1.0.dist-info → scribble_annotation_generator-0.1.1.dist-info}/METADATA +1 -1
- {scribble_annotation_generator-0.1.0.dist-info → scribble_annotation_generator-0.1.1.dist-info}/RECORD +5 -5
- {scribble_annotation_generator-0.1.0.dist-info → scribble_annotation_generator-0.1.1.dist-info}/WHEEL +0 -0
- {scribble_annotation_generator-0.1.0.dist-info → scribble_annotation_generator-0.1.1.dist-info}/entry_points.txt +0 -0
|
@@ -54,11 +54,13 @@ class GMMRandomGenerator:
|
|
|
54
54
|
num_components: int = 5,
|
|
55
55
|
random_state: int = 0,
|
|
56
56
|
class_names: Optional[List[str]] = None,
|
|
57
|
+
colour_map: Optional[dict[tuple[int, int, int], int]] = None,
|
|
57
58
|
) -> None:
|
|
58
59
|
self.num_classes = num_classes
|
|
59
60
|
self.num_components = num_components
|
|
60
61
|
self.random_state = random_state
|
|
61
62
|
self.class_names = class_names or [f"class_{i}" for i in range(num_classes)]
|
|
63
|
+
self.colour_map = colour_map
|
|
62
64
|
|
|
63
65
|
self.class_gmms: Dict[int, GaussianMixture] = {}
|
|
64
66
|
self.class_stats: Dict[int, Dict[str, float]] = {}
|
|
@@ -193,7 +195,6 @@ class GMMRandomGenerator:
|
|
|
193
195
|
def sample_image(
|
|
194
196
|
self,
|
|
195
197
|
image_shape: Tuple[int, int],
|
|
196
|
-
colour_map: Optional[dict[tuple[int, int, int], int]] = None,
|
|
197
198
|
overlap_iters: int = 40,
|
|
198
199
|
overlap_margin: float = 0.05,
|
|
199
200
|
) -> Tuple[np.ndarray, str]:
|
|
@@ -220,7 +221,7 @@ class GMMRandomGenerator:
|
|
|
220
221
|
image_shape=image_shape,
|
|
221
222
|
objects=objects,
|
|
222
223
|
classes=classes,
|
|
223
|
-
colour_map=colour_map,
|
|
224
|
+
colour_map=self.colour_map,
|
|
224
225
|
)
|
|
225
226
|
|
|
226
227
|
# Generate description string
|
|
@@ -579,6 +580,7 @@ def train_gmm_model(data_dir: str) -> GMMRandomGenerator:
|
|
|
579
580
|
num_classes=num_classes,
|
|
580
581
|
num_components=5,
|
|
581
582
|
class_names=class_names,
|
|
583
|
+
colour_map=colour_map,
|
|
582
584
|
).fit(dataset)
|
|
583
585
|
|
|
584
586
|
return generator
|
|
@@ -617,6 +619,7 @@ def main(argv: Optional[List[str]] = None) -> None:
|
|
|
617
619
|
num_classes=args.num_classes,
|
|
618
620
|
num_components=args.num_components,
|
|
619
621
|
class_names=class_names,
|
|
622
|
+
colour_map=colour_map,
|
|
620
623
|
).fit(dataset)
|
|
621
624
|
print()
|
|
622
625
|
|
|
@@ -626,7 +629,6 @@ def main(argv: Optional[List[str]] = None) -> None:
|
|
|
626
629
|
for idx in range(args.num_samples):
|
|
627
630
|
image, description = generator.sample_image(
|
|
628
631
|
image_shape=(args.height, args.width),
|
|
629
|
-
colour_map=colour_map,
|
|
630
632
|
overlap_iters=args.overlap_iters,
|
|
631
633
|
overlap_margin=args.overlap_margin,
|
|
632
634
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scribble-annotation-generator
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Programmatically generate semi-realistic synthetic scribble annotations based on statistics from existing scribble datasets
|
|
5
5
|
Project-URL: Homepage, https://github.com/alexsenden/scribble-annotation-generator
|
|
6
6
|
Project-URL: Repository, https://github.com/alexsenden/scribble-annotation-generator
|
|
@@ -3,10 +3,10 @@ scribble_annotation_generator/cli.py,sha256=e6Ufmf0CLMrKZCL08pB5RqiiQMNJBU9uZwcL
|
|
|
3
3
|
scribble_annotation_generator/crop_field.py,sha256=zh0jNpjz5_pWzybQNfga9hYqRIYPXysMPp_xNvL37gM,10774
|
|
4
4
|
scribble_annotation_generator/dataset.py,sha256=jauKr8ZBJ1o8jEn8T_RKpVgqu8kwLmucIMyhZCkPiTg,3298
|
|
5
5
|
scribble_annotation_generator/debug.py,sha256=YJnfkBJL7Vwlqz9SWeybAhwID8Pcwzp_RFnL9xPOQyI,1194
|
|
6
|
-
scribble_annotation_generator/gmm_random_generator.py,sha256=
|
|
6
|
+
scribble_annotation_generator/gmm_random_generator.py,sha256=TFcjFAB9gpZdVkCm0p7H_vNVF2NrXmRFonkH0NXyZPY,22230
|
|
7
7
|
scribble_annotation_generator/nn.py,sha256=aSQPkVpvsya942hz02LKoUEkZfL_f7lCvYQ5cI8R3Ts,16627
|
|
8
8
|
scribble_annotation_generator/utils.py,sha256=gluwQSroMd4bg6iwchiv4VBTK57t4OvScH8uv29erWY,13628
|
|
9
|
-
scribble_annotation_generator-0.1.
|
|
10
|
-
scribble_annotation_generator-0.1.
|
|
11
|
-
scribble_annotation_generator-0.1.
|
|
12
|
-
scribble_annotation_generator-0.1.
|
|
9
|
+
scribble_annotation_generator-0.1.1.dist-info/METADATA,sha256=n5U2p5kcY9Jp8uIPU5f-oP7ycP5g4puJ0t3Bbw2pGb4,4309
|
|
10
|
+
scribble_annotation_generator-0.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
11
|
+
scribble_annotation_generator-0.1.1.dist-info/entry_points.txt,sha256=A5UbznzAcE5XF5MZrth2rdLvG2IQXhjK2lhklUf9QyU,89
|
|
12
|
+
scribble_annotation_generator-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|