Create IA.py
Browse files
IA.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from PIL import Image
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
from google.colab import drive
|
6 |
+
drive.mount('/content/drive')
|
7 |
+
|
8 |
+
ruta_google_drive = "/content/drive/MyDrive/Lenguaje/"
|
9 |
+
|
10 |
+
translator = pipeline("translation", model="google/mbt-youtube-100k")
|
11 |
+
|
12 |
+
letras = ['A', 'B', 'C']
|
13 |
+
categorias = ['Frutas', 'Colores', 'Familiares', 'Animales']
|
14 |
+
|
15 |
+
st.title("Proyecto de Lenguaje de Señas")
|
16 |
+
|
17 |
+
opcion = st.sidebar.selectbox("Seleccionar una opción", ["Letras", "Categorías"])
|
18 |
+
|
19 |
+
|
20 |
+
if opcion == "Letras":
|
21 |
+
letra = st.selectbox("Seleccionar una letra", letras)
|
22 |
+
st.write(f"Lenguaje de señas para la letra {letra}")
|
23 |
+
st.image(f"ruta_a_tu_google_drive/A.jpg")
|
24 |
+
|
25 |
+
elif opcion == "Categorías":
|
26 |
+
categoria = st.selectbox("Seleccionar una categoría", categorias)
|
27 |
+
st.write(f"Lenguaje de señas para la categoría {categoria}")
|
28 |
+
st.image(f"ruta_a_tu_google_drive/{categoria}.jpg")
|
29 |
+
|
30 |
+
|