1
0
Fork 0

更新 README.md

This commit is contained in:
ailab 2024-05-27 14:20:01 +08:00
parent c94d26d618
commit 30ca939316
1 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,14 @@ predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])
```
```python
import gradio as gr
pipe = pipeline("image-classification", model="ailab/resnet-dogcat")
gr.Interface.from_pipeline(pipe).launch(server_name="0.0.0.0")
```
![1716790696165.png](https://img2.imgtp.com/2024/05/27/hIlNpCRj.png)
## Conclusion
This repository provides a comprehensive solution for training and performing inference on a Cat-Dog classification task using a ResNet-50 model. The training script demonstrates how to preprocess data, train the model, and save the trained model. The inference script shows how to use the trained model to classify new images.