diff --git a/requirements.txt b/requirements.txt index d8bcf54f..f7689df9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,8 +9,8 @@ Pillow PyYAML>=5.3.1 scipy>=1.4.1 tensorboard>=1.5 -torch==1.7.0 -torchvision==0.8.1 +torch>=1.7.0 +torchvision>=0.8.1 tqdm>=4.41.0 # logging ------------------------------------- @@ -27,4 +27,4 @@ pandas # extras -------------------------------------- thop # FLOPS computation -pycocotools==2.0 # COCO mAP +pycocotools==2.0.2 # COCO mAP diff --git a/utils/plots.py b/utils/plots.py index c90a96b8..8a10e7cd 100644 --- a/utils/plots.py +++ b/utils/plots.py @@ -90,11 +90,11 @@ def output_to_target(output, width, height): # Convert model output to target format [batch_id, class_id, x, y, w, h, conf] if isinstance(output, torch.Tensor): output = output.cpu().numpy() - targets = [] for i, o in enumerate(output): if o is not None: for pred in o: + pred = pred.cpu() box = pred[:4] w = (box[2] - box[0]) / width h = (box[3] - box[1]) / height @@ -104,7 +104,6 @@ def output_to_target(output, width, height): cls = int(pred[5]) targets.append([i, cls, x, y, w, h, conf]) - return np.array(targets)