ultralytics 8.0.40 TensorRT metadata and Results visualizer (#1014)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Bogdan Gheorghe <112427971+bogdan-galileo@users.noreply.github.com>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: Jaap van de Loosdrecht <jaap@vdlmv.nl>
Co-authored-by: Noobtoss <96134731+Noobtoss@users.noreply.github.com>
Co-authored-by: nerdyespresso <106761627+nerdyespresso@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-02-17 20:06:06 +01:00 committed by GitHub
parent e799592718
commit 9047d737f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 576 additions and 280 deletions

View file

@ -85,7 +85,6 @@ class BasePredictor:
self.data = self.args.data # data_dict
self.imgsz = None
self.device = None
self.classes = self.args.classes
self.dataset = None
self.vid_path, self.vid_writer = None, None
self.annotator = None
@ -103,7 +102,7 @@ class BasePredictor:
def write_results(self, results, batch, print_string):
raise NotImplementedError("print_results function needs to be implemented")
def postprocess(self, preds, img, orig_img, classes=None):
def postprocess(self, preds, img, orig_img):
return preds
@smart_inference_mode()
@ -170,13 +169,13 @@ class BasePredictor:
# postprocess
with self.dt[2]:
self.results = self.postprocess(preds, im, im0s, self.classes)
self.results = self.postprocess(preds, im, im0s)
self.run_callbacks("on_predict_postprocess_end")
# visualize, save, write results
for i in range(len(im)):
p, im0 = (path[i], im0s[i].copy()) if self.source_type.webcam or self.source_type.from_img else (path,
im0s)
p, im0 = (path[i], im0s[i].copy()) if self.source_type.webcam or self.source_type.from_img \
else (path, im0s.copy())
p = Path(p)
if self.args.verbose or self.args.save or self.args.save_txt or self.args.show: