Edupy commited on
Commit
8c8306b
·
1 Parent(s): 5c26339

Subiendo modelo y app de Pokémon

Browse files
Files changed (3) hide show
  1. app.py +20 -0
  2. modelo_pokemon.pkl +3 -0
  3. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ from fastai.vision.all import *
3
+ import gradio as gr
4
+
5
+ # Cargar el modelo
6
+ learn = load_learner('modelo_pokemon.pkl')
7
+ categories = learn.dls.vocab
8
+
9
+ def predict(img):
10
+ img = PILImage.create(img)
11
+ pred, pred_idx, probs = learn.predict(img)
12
+ return {categories[i]: float(probs[i]) for i in range(len(categories))}
13
+
14
+ # Interfaz
15
+ gr.Interface(
16
+ fn=predict,
17
+ inputs=gr.Image(),
18
+ outputs=gr.Label(num_top_classes=3),
19
+ title="Detector de Tipos Pokémon"
20
+ ).launch()
modelo_pokemon.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16c39ba669a073d6cc68df14dccf47b5dd773fd7a85dabbfa0f67291637376ec
3
+ size 115047525
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ fastai
2
+ timm
3
+ gradio