Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update detections() self.t = tuple() #2617

Merged
merged 3 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions models/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file contains modules common to various models
# YOLOv5 common modules

import math
from pathlib import Path
Expand Down Expand Up @@ -248,7 +248,7 @@ def __init__(self, imgs, pred, files, times=None, names=None, shape=None):
self.xyxyn = [x / g for x, g in zip(self.xyxy, gn)] # xyxy normalized
self.xywhn = [x / g for x, g in zip(self.xywh, gn)] # xywh normalized
self.n = len(self.pred)
self.t = ((times[i + 1] - times[i]) * 1000 / self.n for i in range(3)) # timestamps (ms)
self.t = tuple((times[i + 1] - times[i]) * 1000 / self.n for i in range(3)) # timestamps (ms)
self.s = shape # inference BCHW shape

def display(self, pprint=False, show=False, save=False, render=False, save_dir=''):
Expand Down Expand Up @@ -277,8 +277,7 @@ def display(self, pprint=False, show=False, save=False, render=False, save_dir='

def print(self):
self.display(pprint=True) # print results
print(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' %
tuple(self.t))
print(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' % self.t)

def show(self):
self.display(show=True) # show results
Expand Down
2 changes: 1 addition & 1 deletion models/experimental.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file contains experimental modules
# YOLOv5 experimental modules

import numpy as np
import torch
Expand Down
2 changes: 2 additions & 0 deletions models/yolo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# YOLOv5 YOLO-specific modules

import argparse
import logging
import sys
Expand Down