Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/ALVHB95/TFM_DataScience_APP
Browse files
app.py
CHANGED
|
@@ -32,14 +32,13 @@ from langchain_community.document_loaders import WebBaseLoader
|
|
| 32 |
from pydantic import BaseModel
|
| 33 |
import shutil
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
# Cell 1: Image Classification Model
|
| 38 |
-
|
| 39 |
-
image_pipeline = pipeline(task="image-classification", model=model1)
|
| 40 |
|
| 41 |
def predict_image(input_img):
|
| 42 |
-
predictions =
|
| 43 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
| 44 |
|
| 45 |
image_gradio_app = gr.Interface(
|
|
|
|
| 32 |
from pydantic import BaseModel
|
| 33 |
import shutil
|
| 34 |
|
| 35 |
+
|
| 36 |
|
| 37 |
# Cell 1: Image Classification Model
|
| 38 |
+
image_pipeline = pipeline(task="image-classification", model="microsoft/resnet-50")
|
|
|
|
| 39 |
|
| 40 |
def predict_image(input_img):
|
| 41 |
+
predictions = model1.predict(input_img)
|
| 42 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
| 43 |
|
| 44 |
image_gradio_app = gr.Interface(
|