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

[Feature] Support Stanford Cars dataset. #893

Merged
merged 9 commits into from
Aug 16, 2022

Conversation

zzc98
Copy link
Contributor

@zzc98 zzc98 commented Jul 5, 2022

Motivation

Support Stanford Car dataset .

Example

>>> from mmcls.data import StanfordCars

>>> data_root = 'data/stanfordcars'
>>> train=StanfordCars(data_prefix=data_root, test_mode=False, pipeline=[])
>>> len(train)
8144
>>> val = StanfordCars(data_prefix=data_root, test_mode=True, pipeline=[])
>>> len(val)
8041

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Jul 5, 2022

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

Merging #893 (37f0469) into dev (e54cfd6) will increase coverage by 0.03%.
The diff coverage is 94.28%.

❗ Current head 37f0469 differs from pull request most recent head 22b479f. Consider uploading reports for the commit 22b479f to get more accurate results

@@            Coverage Diff             @@
##              dev     #893      +/-   ##
==========================================
+ Coverage   85.86%   85.90%   +0.03%     
==========================================
  Files         137      138       +1     
  Lines        9363     9398      +35     
  Branches     1621     1627       +6     
==========================================
+ Hits         8040     8073      +33     
- Misses       1082     1084       +2     
  Partials      241      241              
Flag Coverage Δ
unittests 85.82% <94.28%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcls/datasets/stanford_cars.py 94.11% <94.11%> (ø)
mmcls/datasets/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Ezra-Yu Ezra-Yu changed the base branch from master to dev July 5, 2022 03:51
configs/resnet/resnet50_8xb8_stanford_car.py Outdated Show resolved Hide resolved
configs/resnet/resnet50_8xb8_stanford_car.py Outdated Show resolved Hide resolved
mmcls/datasets/stanford_car.py Outdated Show resolved Hide resolved
mmcls/datasets/stanford_car.py Outdated Show resolved Hide resolved
mmcls/datasets/stanford_car.py Outdated Show resolved Hide resolved
configs/resnet/resnet50_8xb8_stanford_car.py Outdated Show resolved Hide resolved
@Ezra-Yu Ezra-Yu changed the title Support Stanford Car dataset Support Stanford Cars dataset Aug 12, 2022
Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -1,3 +1,4 @@
matplotlib
numpy
packaging
scipy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the scipy to the optional requirement file.

Comment on lines 189 to 191
data = sio.loadmat(self.test_ann_file)
else:
data = sio.loadmat(self.train_ann_file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please import scipy.io only when using it. The scipy package is a little large, and if we only use it in a dataset class, don't make it a required package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in the unit tests.

@mzr1996 mzr1996 changed the title Support Stanford Cars dataset [Feature] Support Stanford Cars dataset. Aug 16, 2022
@mzr1996 mzr1996 merged commit 7b16bcd into open-mmlab:dev Aug 16, 2022
Ezra-Yu added a commit to Ezra-Yu/mmclassification that referenced this pull request Sep 6, 2022
* feat: add stanford car dataset

* feat: add stanford car dataset

* feat: add stanford car dataset

* feat: add stanford car dataset

* feat: add stanford car dataset

* feat: add stanford car dataset

* Update links and using cars insteam of car

* place ependency scipy from runtime to optional

* Fix docstring

Co-authored-by: Ezra-Yu <1105212286@qq.com>
Co-authored-by: mzr1996 <mzr1996@163.com>
@OpenMMLab-Assistant001
Copy link

Hi @zzc98 !First of all, we want to express our gratitude for your significant PR in the MMClassification project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR

We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA

If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution!❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants