Skip to content

Commit 4b43152

Browse files
committed
new example fix
1 parent 9624bca commit 4b43152

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

examples/example_patch_based_inference.ipynb

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
" classes_list=[0, 1, 2, 3, 5, 7],\n",
145145
" resize_initial_size=True,\n",
146146
")\n",
147-
"result = CombineDetections(element_crops, nms_threshold=0.05, match_metric='IOS')"
147+
"result = CombineDetections(element_crops, nms_threshold=0.05)"
148148
]
149149
},
150150
{
@@ -203,7 +203,6 @@
203203
" conf=0.5,\n",
204204
" iou=0.7,\n",
205205
" thickness=8,\n",
206-
" font_scale=1.1,\n",
207206
" show_boxes=True,\n",
208207
" delta_colors=3,\n",
209208
" show_class=False,\n",
@@ -218,7 +217,6 @@
218217
" classes_ids=result.filtered_classes_id,\n",
219218
" classes_names=result.filtered_classes_names,\n",
220219
" thickness=8,\n",
221-
" font_scale=1.1,\n",
222220
" show_boxes=True,\n",
223221
" delta_colors=3,\n",
224222
" show_class=False,\n",
@@ -306,7 +304,7 @@
306304
" classes_list=[0, 1, 2, 3, 5, 7],\n",
307305
" resize_initial_size=False,\n",
308306
")\n",
309-
"result = CombineDetections(element_crops, nms_threshold=0.05, match_metric='IOS')\n",
307+
"result = CombineDetections(element_crops, nms_threshold=0.05)\n",
310308
"\n",
311309
"print('Before nms:')\n",
312310
"visualize_results(\n",
@@ -399,7 +397,7 @@
399397
" classes_list=[0, 1, 2, 3, 5, 7],\n",
400398
" resize_initial_size=True,\n",
401399
")\n",
402-
"result = CombineDetections(element_crops, nms_threshold=0.05, match_metric='IOS')\n",
400+
"result = CombineDetections(element_crops, nms_threshold=0.05)\n",
403401
"\n",
404402
"print('Basic yolo inference:')\n",
405403
"visualize_results_usual_yolo_inference(\n",
@@ -410,7 +408,6 @@
410408
" iou=0.7,\n",
411409
" segment=False,\n",
412410
" thickness=8,\n",
413-
" font_scale=1.1,\n",
414411
" show_boxes=True,\n",
415412
" delta_colors=3,\n",
416413
" show_class=False,\n",
@@ -479,7 +476,7 @@
479476
" classes_list=[0, 1, 2, 3, 5, 7],\n",
480477
" resize_initial_size=True,\n",
481478
")\n",
482-
"result = CombineDetections(element_crops, nms_threshold=0.5, match_metric='IOS')"
479+
"result = CombineDetections(element_crops, nms_threshold=0.5)"
483480
]
484481
},
485482
{
@@ -539,7 +536,6 @@
539536
" iou=0.7,\n",
540537
" segment=True,\n",
541538
" thickness=8,\n",
542-
" font_scale=1.1,\n",
543539
" fill_mask=True,\n",
544540
" show_boxes=False,\n",
545541
" delta_colors=3,\n",
@@ -557,7 +553,6 @@
557553
" classes_names=result.filtered_classes_names,\n",
558554
" segment=True,\n",
559555
" thickness=8,\n",
560-
" font_scale=1.1,\n",
561556
" fill_mask=True,\n",
562557
" show_boxes=False,\n",
563558
" delta_colors=3,\n",
@@ -593,7 +588,7 @@
593588
" classes_list=[0, 1, 2, 3, 5, 7],\n",
594589
" resize_initial_size=True,\n",
595590
")\n",
596-
"result = CombineDetections(element_crops, nms_threshold=0.5, match_metric='IOS')"
591+
"result = CombineDetections(element_crops, nms_threshold=0.5)"
597592
]
598593
},
599594
{
@@ -646,7 +641,6 @@
646641
" iou=0.7,\n",
647642
" segment=True,\n",
648643
" thickness=8,\n",
649-
" font_scale=1.1,\n",
650644
" fill_mask=True,\n",
651645
" show_boxes=False,\n",
652646
" delta_colors=3,\n",
@@ -664,7 +658,6 @@
664658
" classes_names=result.filtered_classes_names,\n",
665659
" segment=True,\n",
666660
" thickness=8,\n",
667-
" font_scale=1.1,\n",
668661
" fill_mask=True,\n",
669662
" show_boxes=False,\n",
670663
" delta_colors=3,\n",
@@ -754,7 +747,7 @@
754747
" classes_list=[0, 1, 2, 3, 5, 7],\n",
755748
" resize_initial_size=True,\n",
756749
")\n",
757-
"result = CombineDetections(element_crops, nms_threshold=0.25, match_metric='IOS')\n",
750+
"result = CombineDetections(element_crops, nms_threshold=0.25)\n",
758751
"\n",
759752
"print('Basic rtdetr inference:')\n",
760753
"visualize_results_usual_yolo_inference(\n",
@@ -890,7 +883,7 @@
890883
" iou=0.8,\n",
891884
" resize_initial_size=True,\n",
892885
")\n",
893-
"result = CombineDetections(element_crops, nms_threshold=0.40, match_metric='IOS')\n",
886+
"result = CombineDetections(element_crops, nms_threshold=0.40)\n",
894887
"\n",
895888
"print('Basic FastSAM inference:')\n",
896889
"visualize_results_usual_yolo_inference(\n",
@@ -1034,9 +1027,10 @@
10341027
" imgsz=416,\n",
10351028
" classes_list=[0, 1, 2, 3, 5, 7],\n",
10361029
" resize_initial_size=True,\n",
1037-
" memory_optimize=False\n",
1030+
" memory_optimize=False,\n",
1031+
" inference_extra_args={'retina_masks':True}\n",
10381032
")\n",
1039-
"result = CombineDetections(element_crops, nms_threshold=0.5, match_metric='IOS')\n",
1033+
"result = CombineDetections(element_crops, nms_threshold=0.5)\n",
10401034
"\n",
10411035
"print('YOLO-Patch-Based-Inference:')\n",
10421036
"visualize_results(\n",
@@ -1048,7 +1042,6 @@
10481042
" classes_names=result.filtered_classes_names,\n",
10491043
" segment=True,\n",
10501044
" thickness=6,\n",
1051-
" font_scale=1.1,\n",
10521045
" fill_mask=True,\n",
10531046
" show_boxes=False,\n",
10541047
" delta_colors=3,\n",
@@ -1129,7 +1122,6 @@
11291122
" masks=element_crops.crops[i].detected_masks,\n",
11301123
" segment=True,\n",
11311124
" thickness=1,\n",
1132-
" font_scale=1.2,\n",
11331125
" fill_mask=True,\n",
11341126
" show_boxes=True,\n",
11351127
" delta_colors=3,\n",
@@ -1145,7 +1137,6 @@
11451137
" masks=element_crops.crops[i].detected_masks_real,\n",
11461138
" segment=True,\n",
11471139
" thickness=1,\n",
1148-
" font_scale=1.2,\n",
11491140
" fill_mask=True,\n",
11501141
" show_boxes=True,\n",
11511142
" delta_colors=3,\n",

0 commit comments

Comments
 (0)