Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory_optimize=False yields no results #13

Closed
Marvin1412 opened this issue Jul 13, 2024 · 2 comments
Closed

memory_optimize=False yields no results #13

Marvin1412 opened this issue Jul 13, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Marvin1412
Copy link

Using the following code I only get emtpy polygons if memory_optimize is set to False. Otherwise I yield good results. Any Idea why? I'd also be interested what your POV is on the different paramters and what is optimal if I really try to not overlook something? Greetings and Thank you!

element_crops = MakeCropsDetectThem(
imgsz =800,
image=left_image,
model_path="yolov8m-seg.pt",
segment=True,
show_crops=False,
shape_x=400,
shape_y=400,
overlap_x=10,
overlap_y=10,
conf=0.5,
iou=0.9,
memory_optimize=False,
classes_list = list(range(80)),
resize_initial_size=True,
)
result = CombineDetections(element_crops, nms_threshold=0.5, match_metric='IOS')

visualize_results(
img=result.image,
confidences=result.filtered_confidences,
boxes=result.filtered_boxes,
polygons=result.filtered_polygons,
classes_ids=result.filtered_classes_id,
classes_names=result.filtered_classes_names,
segment=True,
thickness=8,
font_scale=1.1,
fill_mask=True,
show_boxes=False,
delta_colors=3,
show_class=False,
axis_off=False
)

@Koldim2001
Copy link
Owner

Koldim2001 commented Jul 14, 2024

Try:

visualize_results(
img=result.image,
confidences=result.filtered_confidences,
boxes=result.filtered_boxes,
masks=result.filtered_masks,
classes_ids=result.filtered_classes_id,
classes_names=result.filtered_classes_names,
segment=True,
thickness=8,
font_scale=1.1,
fill_mask=True,
show_boxes=False,
delta_colors=3,
show_class=False,
axis_off=False
)

The reason is that when working with a more accurate mask inference mode, all processing is carried out in masks, not polygons (therefore, you need to feed the visualization function masks=result.filtered_masks)

#9

@Marvin1412
Copy link
Author

Thank you for the Answer!

@Koldim2001 Koldim2001 added the question Further information is requested label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants