File size: 728 Bytes
ee20479 3ac9479 ee20479 3ac9479 ee20479 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
---
tags:
- custom_code
---
# How to use
you can the model via the command
```python
from transformers import AutoModelForImageClassification
model = AutoModelForImageClassification.from_pretrained("not-lain/MyRepo1.0", trust_remote_code=True)
```
or you can use the pipeline
```python
from transformers import pipeline
pipe = pipeline(model="not-lain/MyRepo1.0", trust_remote_code=True)
pipe(
"url",
download=True, # will call the download_img method
clean_output=False # will be passed as postprocess_kwargs
)
```
# parameters
the pipeline supports the following parameters :
* download
* clean_output
you can also use the following method to download images from the web
```python
pipe.download_img(url)
```
|