Skip to content

Commit

Permalink
Update dataset names from array to dictionary (ultralytics#9000)
Browse files Browse the repository at this point in the history
* Migrate dataset names to dictionary

* fix check

* backwards compat

* predict fix

* val fix

* Keep dataset stats behavior identical

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
glenn-jocher authored and Clay Januhowski committed Sep 8, 2022
1 parent a245c33 commit b7bc78f
Show file tree
Hide file tree
Showing 15 changed files with 1,646 additions and 227 deletions.
2 changes: 1 addition & 1 deletion classify/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run(
p = F.softmax(results, dim=1) # probabilities
i = p.argsort(1, descending=True)[:, :5].squeeze() # top 5 indices
dt[2] += time_sync() - t3
LOGGER.info(f"image 1/1 {file}: {imgsz}x{imgsz} {', '.join(f'{model.names[j]} {p[0, j]:.2f}' for j in i)}")
LOGGER.info(f"image 1/1 {file}: {imgsz}x{imgsz} {', '.join(f'{model.names[j]} {p[0, j]:.2f}' for j in i.tolist())}")

# Print results
t = tuple(x / seen * 1E3 for x in dt) # speeds per image
Expand Down
11 changes: 9 additions & 2 deletions data/Argoverse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ val: Argoverse-1.1/images/val/ # val images (relative to 'path') 15062 images
test: Argoverse-1.1/images/test/ # test images (optional) https://eval.ai/web/challenges/challenge-page/800/overview

# Classes
nc: 8 # number of classes
names: ['person', 'bicycle', 'car', 'motorcycle', 'bus', 'truck', 'traffic_light', 'stop_sign'] # class names
names:
0: person
1: bicycle
2: car
3: motorcycle
4: bus
5: truck
6: traffic_light
7: stop_sign


# Download script/URL (optional) ---------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions data/GlobalWheat2020.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ test: # test images (optional) 1276 images
- images/uq_1

# Classes
nc: 1 # number of classes
names: ['wheat_head'] # class names
names:
0: wheat_head


# Download script/URL (optional) ---------------------------------------------------------------------------------------
Expand Down
1,138 changes: 1,002 additions & 136 deletions data/ImageNet.yaml

Large diffs are not rendered by default.

Loading

0 comments on commit b7bc78f

Please sign in to comment.