Skip to content

Commit

Permalink
Update links and using cars insteam of car
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra-Yu committed Aug 12, 2022
1 parent 7b0538e commit 7b1af11
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# dataset settings
dataset_type = 'StanfordCar'
dataset_type = 'StanfordCars'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
Expand Down
6 changes: 6 additions & 0 deletions configs/resnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ The pre-trained models on ImageNet-21k are used to fine-tune, and therefore don'
| :-------: | :--------------------------------------------------: | :--------: | :-------: | :------: | :-------: | :------------------------------------------------: | :---------------------------------------------------: |
| ResNet-50 | [ImageNet-21k-mill](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_3rdparty-mill_in21k_20220331-faac000b.pth) | 448x448 | 23.92 | 16.48 | 88.45 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/resnet/resnet50_8xb8_cub.py) | [model](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cub_20220307-57840e60.pth) \| [log](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cub_20220307-57840e60.log.json) |

### Stanford-Cars

| Model | Pretrain | resolution | Params(M) | Flops(G) | Top-1 (%) | Config | Download |
| :-------: | :--------------------------------------------------: | :--------: | :-------: | :------: | :-------: | :------------------------------------------------: | :---------------------------------------------------: |
| ResNet-50 | [ImageNet-21k-mill](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_3rdparty-mill_in21k_20220331-faac000b.pth) | 448x448 | 23.92 | 16.48 | 92.82 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/resnet/resnet50_8xb8_cars.py) | [model](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cars_20220812-9d85901a.pth) \| [log](https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cars_20220812-9d85901a.log.json) |

## Citation

```
Expand Down
13 changes: 13 additions & 0 deletions configs/resnet/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,16 @@ Models:
Pretrain: https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_3rdparty-mill_in21k_20220331-faac000b.pth
Weights: https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cub_20220307-57840e60.pth
Config: configs/resnet/resnet50_8xb8_cub.py
- Name: resnet50_8xb8_cars
Metadata:
FLOPs: 16480000000
Parameters: 23920000
In Collection: ResNet
Results:
- Dataset: StanfordCars
Metrics:
Top 1 Accuracy: 92.82
Task: Image Classification
Pretrain: https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_3rdparty-mill_in21k_20220331-faac000b.pth
Weights: https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb8_cars_20220812-9d85901a.pth
Config: configs/resnet/resnet50_8xb8_cars.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_base_ = [
'../_base_/models/resnet50.py',
'../_base_/datasets/stanford_car_bs8_448.py',
'../_base_/schedules/stanford_car_bs8.py', '../_base_/default_runtime.py'
'../_base_/datasets/stanford_cars_bs8_448.py',
'../_base_/schedules/stanford_cars_bs8.py', '../_base_/default_runtime.py'
]

# use pre-train weight converted from https://github.com/Alibaba-MIIL/ImageNet21K # noqa
Expand Down
4 changes: 2 additions & 2 deletions mmcls/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .mnist import MNIST, FashionMNIST
from .multi_label import MultiLabelDataset
from .samplers import DistributedSampler, RepeatAugSampler
from .stanford_car import StanfordCar
from .stanford_car import StanfordCars
from .voc import VOC

__all__ = [
Expand All @@ -21,5 +21,5 @@
'DistributedSampler', 'ConcatDataset', 'RepeatDataset',
'ClassBalancedDataset', 'DATASETS', 'PIPELINES', 'ImageNet21k', 'SAMPLERS',
'build_sampler', 'RepeatAugSampler', 'KFoldDataset', 'CUB',
'CustomDataset', 'StanfordCar'
'CustomDataset', 'StanfordCars'
]
13 changes: 7 additions & 6 deletions mmcls/datasets/stanford_car.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@


@DATASETS.register_module()
class StanfordCar(BaseDataset):
"""`Stanford Car <https://ai.stanford.edu/~jkrause/cars/car_dataset.html>`_
Dataset.
class StanfordCars(BaseDataset):
"""`Stanford Cars.
<https://ai.stanford.edu/~jkrause/cars/car_dataset.html>`_ Dataset.
After downloading and decompression, the dataset
directory structure is as follows.
Stanford Car dataset directory:
Stanford Cars dataset directory:
Stanford Car
Stanford Cars
├── cars_train
│ ├── 00001.jpg
│ ├── 00002.jpg
Expand Down Expand Up @@ -176,7 +177,7 @@ def __init__(self,
self.train_ann_file = osp.join(data_prefix,
'devkit/cars_train_annos.mat')
data_prefix = osp.join(data_prefix, 'cars_train')
super(StanfordCar, self).__init__(
super(StanfordCars, self).__init__(
ann_file=ann_file,
data_prefix=data_prefix,
test_mode=test_mode,
Expand Down
1 change: 1 addition & 0 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
matplotlib
numpy
packaging
scipy
1 change: 0 additions & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ interrogate
isort==4.3.21
mmdet
pytest
scipy
xdoctest >= 0.10.0
yapf
4 changes: 2 additions & 2 deletions tests/test_data/test_datasets/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ def tearDownClass(cls):
cls.tmpdir.cleanup()


class TestStanfordCar(TestBaseDataset):
DATASET_TYPE = 'StanfordCar'
class TestStanfordCars(TestBaseDataset):
DATASET_TYPE = 'StanfordCars'

def test_initialize(self):
dataset_class = DATASETS.get(self.DATASET_TYPE)
Expand Down

0 comments on commit 7b1af11

Please sign in to comment.