Spaces:
Sleeping
Sleeping
mateoluksenberg
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,7 @@
|
|
|
|
1 |
|
2 |
-
|
3 |
-
from PIL import Image
|
4 |
-
|
5 |
-
# Cargar el pipeline para clasificaci贸n de im谩genes
|
6 |
-
pipe = pipeline("image-classification", model="mateoluksenberg/dit-base-Classifier_CM05")
|
7 |
-
|
8 |
-
# Ruta a la imagen que deseas clasificar dentro del contenedor
|
9 |
-
image_path = 'cm5.jpg'
|
10 |
-
|
11 |
-
# Abrir la imagen desde la ruta local y convertirla a RGB
|
12 |
-
image = Image.open(image_path).convert('RGB')
|
13 |
-
|
14 |
-
# Realizar la clasificaci贸n de la imagen
|
15 |
-
result = pipe(image)
|
16 |
-
|
17 |
-
# Imprimir el resultado
|
18 |
-
print(result)
|
19 |
-
|
20 |
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
|
3 |
+
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
@app.get("/")
|
6 |
+
def greet_json():
|
7 |
+
return {"Hello": "World!"}
|