Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/tasks/src/tasks/image-classification/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ With the `transformers` library, you can use the `image-classification` pipeline

```python
from transformers import pipeline
clf = pipeline("image-classification")
clf("path_to_a_cat_image")

[{'label': 'tabby cat', 'score': 0.731},
...
]
image_classifier = pipeline(task="image-classification", model="microsoft/resnet-50")
image_classifier("path_to_a_cat_image")

[{'label': 'Egyptian cat', 'score': 0.7005051970481873},
{'label': 'tabby, tabby cat', 'score': 0.16163259744644165},
{'label': 'tiger cat', 'score': 0.04507654905319214},
{'label': 'lynx, catamount', 'score': 0.011848953552544117},
{'label': 'bucket, pail', 'score': 0.009444382973015308}]
```

You can use [huggingface.js](https://github.com/huggingface/huggingface.js) to classify images using models on Hugging Face Hub.
Expand Down