"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "bc7ea032350a5b6f5e4f8c440df7590af5527785"
Unverified Commit 78f346c2 authored by NielsRogge's avatar NielsRogge Committed by GitHub
Browse files

Update README.md (#16797)

parent ee209d4d
......@@ -16,14 +16,14 @@ limitations under the License.
# Image classification example
This directory contains a script, `run_image_classification.py`, that showcases how to fine-tune any model supported by the [`AutoModelForImageClassification` API](https://huggingface.co/docs/transformers/main/en/model_doc/auto#transformers.AutoModelForImageClassification) (such as [ViT](https://huggingface.co/docs/transformers/main/en/model_doc/vit), [ConvNeXT]((https://huggingface.co/docs/transformers/main/en/model_doc/convnext)), [ResNet]((https://huggingface.co/docs/transformers/main/en/model_doc/resnet)), [Swin Transformer]((https://huggingface.co/docs/transformers/main/en/model_doc/swin))...) using PyTorch. It can be used to fine-tune models on both well-known datasets (like [CIFAR-10](https://huggingface.co/datasets/cifar10), [Fashion MNIST](https://huggingface.co/datasets/fashion_mnist), ...) as well as on your own custom data.
This directory contains a script, `run_image_classification.py`, that showcases how to fine-tune any model supported by the [`AutoModelForImageClassification` API](https://huggingface.co/docs/transformers/main/en/model_doc/auto#transformers.AutoModelForImageClassification) (such as [ViT](https://huggingface.co/docs/transformers/main/en/model_doc/vit), [ConvNeXT](https://huggingface.co/docs/transformers/main/en/model_doc/convnext), [ResNet](https://huggingface.co/docs/transformers/main/en/model_doc/resnet), [Swin Transformer](https://huggingface.co/docs/transformers/main/en/model_doc/swin)...) using PyTorch. It can be used to fine-tune models on both well-known datasets (like [CIFAR-10](https://huggingface.co/datasets/cifar10), [Fashion MNIST](https://huggingface.co/datasets/fashion_mnist), ...) as well as on your own custom data.
This page includes 2 sections:
- [Using datasets from the hub](#using-datasets-from-🤗-hub)
- [Using datasets from the 🤗 hub](#using-datasets-from-hub)
- [Using your own data](#using-your-own-data).
## Using datasets from 🤗 `Hub`
## Using datasets from Hub
Here we show how to fine-tune a Vision Transformer (`ViT`) on the [beans](https://huggingface.co/datasets/beans) dataset, to classify the disease type of bean leaves.
......@@ -53,8 +53,6 @@ python run_image_classification.py \
To fine-tune another model, simply provide the `--model_name_or_path` argument. To train on another dataset, simply set the `--dataset_name` argument.
👀 See the results here: [nateraw/vit-base-cats-vs-dogs](https://huggingface.co/nateraw/vit-base-cats-vs-dogs).
## Using your own data
To use your own dataset, there are 2 ways:
......@@ -125,7 +123,7 @@ dataset.push_to_hub("name_of_your_dataset")
dataset.push_to_hub("name_of_your_dataset", private=True)
```
and that's it! You can now simply train your model simply by setting the `--dataset_name` argument to the name of your dataset on the hub (as explained in [Using datasets from the hub](#using-datasets-from-🤗-hub)).
and that's it! You can now simply train your model simply by setting the `--dataset_name` argument to the name of your dataset on the hub (as explained in [Using datasets from the 🤗 hub](#using-datasets-from-hub)).
More on this can also be found in [this blog post](https://huggingface.co/blog/image-search-datasets).
......@@ -148,14 +146,6 @@ $ huggingface-cli login
# ...follow the prompts
```
or, in case you're running in a notebook:
```python
from huggingface_hub import notebook_login
notebook_login()
```
3. When running the script, pass the following arguments:
```bash
......@@ -163,4 +153,4 @@ python run_image_classification.py \
--push_to_hub \
--push_to_hub_model_id <name-your-model> \
...
```
\ No newline at end of file
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment