Spaces:
Sleeping
Sleeping
Adding changes
Browse files
app.py
CHANGED
|
@@ -1,19 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import numpy as np
|
| 3 |
-
import tensorflow as tf
|
| 4 |
-
from PIL import Image
|
| 5 |
-
def clasifica_imagen(inp):
|
| 6 |
-
inp = inp.resize((224,224))
|
| 7 |
-
inp = np.asarray(inp)[:,:,:3]
|
| 8 |
-
inp = inp.reshape(-1,224,224,3)
|
| 9 |
-
inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
| 10 |
-
prediction = inception_net.predict(inp).flatten()
|
| 11 |
-
confidences = {etiquetas[i] : float(prediction[i]) for i in range(len(etiquetas)-1)}
|
| 12 |
-
return confidences
|
| 13 |
|
| 14 |
-
demo=gr.
|
| 15 |
-
inputs=gr.Image(type='pil',height=200, width = 200),
|
| 16 |
-
outputs = gr.Label(num_top_classes = 3)
|
| 17 |
-
)
|
| 18 |
|
| 19 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
demo.launch()
|