model.names for dataParallel

This commit is contained in:
Glenn Jocher committed 2020-06-04 13:30:14 -07:00
1 parent 0362f103ef
commit ba9ab663a2
2 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ def detect(save_img=False):
dataset = LoadImages(source, img_size=imgsz)
# Get names and colors
names = model.names
names = model.module.names if hasattr(model, 'module') else model.names
colors = [[random.randint(0, 255) for _ in range(3)] for _ in range(len(names))]
# Run inference