Do not look for segment when there aren't any
This line will crash when there are no masks
. This happens for every detect
models.
We should first look for the type of child. Then decide whether we should look for masks or bbox.
This section should become
# Build valid children
child_type = results.names[results.boxes.cls[i].cpu().item()]
child_types.update({child_type: 1})
if child_type in self.use_segment:
# Look for segment
else:
# look for box