From 30ca9393165fd5ec41d074c7f0b39b6f4cd04c0f Mon Sep 17 00:00:00 2001 From: ailab Date: Mon, 27 May 2024 14:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index d918159..7b237cb 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file