Skip to content

Commit a00d36f

Browse files
author
mikel.brostrom
committed
yolov5 as submodule
1 parent 05fa19e commit a00d36f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+12
-7027
lines changed

Diff for: .gitignore

-1
This file was deleted.

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "yolov5"]
2+
path = yolov5
3+
url = https://github.com/ultralytics/yolov5.git

Diff for: track.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import sys
2+
sys.path.insert(0, './yolov5')
3+
14
from yolov5.utils.datasets import LoadImages, LoadStreams
2-
from yolov5.utils.general import (
3-
check_img_size, non_max_suppression, apply_classifier, scale_coords, xyxy2xywh, plot_one_box, strip_optimizer)
4-
from yolov5.utils.torch_utils import select_device, load_classifier, time_synchronized
5+
from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords
6+
from yolov5.utils.torch_utils import select_device, time_synchronized
57
from deep_sort_pytorch.utils.parser import get_config
68
from deep_sort_pytorch.deep_sort import DeepSort
79
import argparse
@@ -13,15 +15,13 @@
1315
import cv2
1416
import torch
1517
import torch.backends.cudnn as cudnn
16-
# https://github.com/pytorch/pytorch/issues/3678
17-
import sys
18-
sys.path.insert(0, './yolov5')
18+
1919

2020

2121
palette = (2 ** 11 - 1, 2 ** 15 - 1, 2 ** 20 - 1)
2222

2323

24-
def bbox_rel(image_width, image_height, *xyxy):
24+
def bbox_rel(*xyxy):
2525
"""" Calculates the relative bounding box from absolute pixel values. """
2626
bbox_left = min([xyxy[0].item(), xyxy[2].item()])
2727
bbox_top = min([xyxy[1].item(), xyxy[3].item()])
@@ -159,8 +159,7 @@ def detect(opt, save_img=False):
159159

160160
# Adapt detections to deep sort input format
161161
for *xyxy, conf, cls in det:
162-
img_h, img_w, _ = im0.shape
163-
x_c, y_c, bbox_w, bbox_h = bbox_rel(img_w, img_h, *xyxy)
162+
x_c, y_c, bbox_w, bbox_h = bbox_rel(*xyxy)
164163
obj = [x_c, y_c, bbox_w, bbox_h]
165164
bbox_xywh.append(obj)
166165
confs.append([conf.item()])

Diff for: yolov5

Submodule yolov5 added at f010147

Diff for: yolov5/.dockerignore

-215
This file was deleted.

Diff for: yolov5/.gitattributes

-2
This file was deleted.

Diff for: yolov5/.github/ISSUE_TEMPLATE/--bug-report.md

-55
This file was deleted.

Diff for: yolov5/.github/ISSUE_TEMPLATE/--feature-request.md

-27
This file was deleted.

Diff for: yolov5/.github/ISSUE_TEMPLATE/-question.md

-13
This file was deleted.

0 commit comments

Comments
 (0)