Skip to content

Commit 26a21e1

Browse files
Merge pull request #2953 from avinashkranjan/deepsource-transform-4b48d65c
format code with autopep8
2 parents b7d7f1e + c79c97a commit 26a21e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Car Detection OpenCV/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
height, width, _ = frame.shape
2121

22-
23-
blob = cv2.dnn.blobFromImage(frame, 0.00392, (416, 416), (0, 0, 0), True, crop=False)
22+
blob = cv2.dnn.blobFromImage(
23+
frame, 0.00392, (416, 416), (0, 0, 0), True, crop=False)
2424
yolo_net.setInput(blob)
2525

2626
layer_names = yolo_net.getUnconnectedOutLayersNames()
@@ -32,7 +32,7 @@
3232

3333
class_id = np.argmax(scores)
3434
confidence = scores[class_id]
35-
if confidence > 0.5 and class_id == 2:
35+
if confidence > 0.5 and class_id == 2:
3636
center_x = int(detection[0] * width)
3737

3838
center_y = int(detection[1] * height)
@@ -42,9 +42,9 @@
4242

4343
x = int(center_x - bbox_width / 2)
4444
y = int(center_y - bbox_height / 2)
45-
cv2.rectangle(frame, (x, y), (x + bbox_width, y + bbox_height), (0, 255, 0), 2)
45+
cv2.rectangle(frame, (x, y), (x + bbox_width,
46+
y + bbox_height), (0, 255, 0), 2)
4647

47-
4848
resized_frame = cv2.resize(frame, (720, 480))
4949

5050
cv2.imshow('Car Tracking', frame)

0 commit comments

Comments
 (0)