ntsc207 commited on
Commit
8ddd3c2
·
verified ·
1 Parent(s): dd0e990

Update detect_deepsort.py

Browse files
Files changed (1) hide show
  1. detect_deepsort.py +8 -8
detect_deepsort.py CHANGED
@@ -65,11 +65,11 @@ def colorLabels(classid):
65
  if classid == 0: #Bus
66
  color = (0, 0, 255)
67
  elif classid == 1: #Bike 250, 247, 0
68
- color = (0,148,255)
69
  elif classid == 2: #Car
70
  color = (0, 255, 10)
71
  elif classid == 3: #Pedestrian
72
- color = (250,247,0)
73
  else: #Truck
74
  color = (235,0,255)
75
  return tuple(color)
@@ -100,12 +100,12 @@ def draw_boxes(frame, bbox_xyxy, draw_trails, identities=None, categories=None,
100
  data_deque[id] = deque(maxlen= 64)
101
  data_deque[id].appendleft(center)
102
  cv2.rectangle(frame, (x1, y1), (x2, y2), color, 2)
103
- name = className[cat]
104
- label = str(id) + ":" + name
105
- text_size = cv2.getTextSize(label, 0, fontScale=0.5, thickness=2)[0]
106
- c2 = x1 + text_size[0], y1 - text_size[1] - 3
107
- cv2.rectangle(frame, (x1, y1), c2, color, -1)
108
- cv2.putText(frame, label, (x1, y1 - 2), 0, 0.5, [255, 255, 255], thickness=1, lineType=cv2.LINE_AA)
109
  cv2.circle(frame,center, 2, (0,255,0), cv2.FILLED)
110
  if draw_trails:
111
  # draw trail
 
65
  if classid == 0: #Bus
66
  color = (0, 0, 255)
67
  elif classid == 1: #Bike 250, 247, 0
68
+ color = (250, 247, 0)
69
  elif classid == 2: #Car
70
  color = (0, 255, 10)
71
  elif classid == 3: #Pedestrian
72
+ color = (0,148,255)
73
  else: #Truck
74
  color = (235,0,255)
75
  return tuple(color)
 
100
  data_deque[id] = deque(maxlen= 64)
101
  data_deque[id].appendleft(center)
102
  cv2.rectangle(frame, (x1, y1), (x2, y2), color, 2)
103
+ # name = className[cat]
104
+ # label = str(id) + ":" + name
105
+ # text_size = cv2.getTextSize(label, 0, fontScale=0.5, thickness=2)[0]
106
+ # c2 = x1 + text_size[0], y1 - text_size[1] - 3
107
+ # cv2.rectangle(frame, (x1, y1), c2, color, -1)
108
+ # cv2.putText(frame, label, (x1, y1 - 2), 0, 0.5, [255, 255, 255], thickness=1, lineType=cv2.LINE_AA)
109
  cv2.circle(frame,center, 2, (0,255,0), cv2.FILLED)
110
  if draw_trails:
111
  # draw trail