Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from daggr import Graph, GradioNode | |
| # ================================================================= | |
| # 1. NODO TRADUCTOR | |
| # ================================================================= | |
| traductor = GradioNode( | |
| name="traductor", | |
| space_or_url="JesusJimenez01/proyecto1-traductor", | |
| inputs={ | |
| "text": gr.Textbox(label="Input Español") | |
| }, | |
| outputs={ | |
| "outputs": gr.Textbox(label="Output Traducción") | |
| } | |
| ) | |
| # ================================================================= | |
| # 2. NODO VISIÓN | |
| # ================================================================= | |
| vision = GradioNode( | |
| name="vision", | |
| space_or_url="JesusJimenez01/proyecto1-vision", | |
| inputs={ | |
| "image": gr.Image(label="Imagen Input"), | |
| "text_en": traductor.outputs | |
| }, | |
| outputs={ | |
| "image_output": gr.Image(label="Imagen Detectada"), | |
| "json_output": gr.JSON(label="Datos de Detección") | |
| } | |
| ) | |
| # ================================================================= | |
| # 3. GRAFO | |
| # ================================================================= | |
| dag = Graph( | |
| name="flujo-vision-traduccion", | |
| nodes=[traductor, vision] | |
| ) | |
| if __name__ == "__main__": | |
| dag.launch() |