Chris-hughes10 / Yolov7-training

A clean, modular implementation of the Yolov7 model family, which uses the official pretrained weights, with utilities for training the model on custom (non-COCO) tasks.
GNU General Public License v3.0
116 stars 35 forks source link

if bbox error #4

Closed GeorgePearse closed 1 year ago

GeorgePearse commented 1 year ago

Hey Chris, excellent bit of work, both the blog post and this repo. I'm just borrowing your mixup and mosaic augmentation implementations for the timebeing but I'm a little confused by this line:

https://github.com/Chris-hughes10/Yolov7-training/blob/d605d864b5f728ec298572b78e72543434988081/yolov7/plotting.py#L105

For me it was causing this error:

 The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

e.g. Python has no idea what we're checking the truth of when we feed it the bbox list, which I would have thought is the default happy path?

For my use case I've just removed the condition.

Chris-hughes10 commented 1 year ago

Hi, this is probably where the docstring could be improved! The plotting methods require the boxes and class labels as lists rather than tensors or arrays. If you call .tolist() on your array it should work