How tyyds-ai/endoagent works
EndoAgent is a multimodal endoscopy analysis system. The principal workflow starts with a user submitting an image and question through a Gradio interface; an agent can dispatch image-analysis tools and return a response. The tools also support report generation, visualization, polyp synthesis and removal, and image enhancement. The README additionally documents dataset preparation and evaluation capabilities, represented as separate branches. Tool call relationships are shown where excerpts or the source index support them; some interface and tool wiring is only partially sampled.
Main entry points: gradio.py Tool-calling agent · report_generation.py Report generation · endoagent_reflexion.py Visual evaluation · vqa.py Visual Q&A
Components 18
User interaction
- Gradio app
gradio.py - Chinese interface
interface_zh.py - English interface
interface_en.py - Tool-calling agent
gradio.py
Image analysis
- Classification
endoagent/tools/classification.py - Detection
endoagent/tools/detection.py - Segmentation
endoagent/tools/segmentation.py - Visual Q&A
endoagent/tools/vqa.py - Report generation
endoagent/tools/report_generation.py - Result visualization
endoagent/tools/visualizer.py - Image enhancement
endoagent/tools/enhancer.py
Image generation
- Polyp generation
endoagent/tools/generation_polyp.py - Polyp removal
endoagent/tools/generation_normal.py
Data and evaluation
- Dataset preparation
data_prepare - Visual evaluation
evalutaion/visual_tasks/endoagent_reflexion.py - Language evaluation
evalutaion/language_task
Other components
- User
- OpenAI model
Connections 28
- User → Chinese interface: submits request
README.md - User → English interface: submits request
README.md - Gradio app → Chinese interface: creates interface
gradio.py - Gradio app → Tool-calling agent: initializes agent
gradio.py - Chinese interface → Tool-calling agent: sends requests
interface_zh.py - English interface → Tool-calling agent: sends requests
interface_en.py - Tool-calling agent → Classification: dispatches tools
gradio.py - Tool-calling agent → Detection: dispatches tools
gradio.py - Tool-calling agent → Segmentation: dispatches tools
gradio.py - Tool-calling agent → Visual Q&A: dispatches tools
gradio.py - Tool-calling agent → Report generation: dispatches tools
gradio.py - Tool-calling agent → Result visualization: dispatches tools
- Tool-calling agent → Image enhancement: dispatches tools
- Tool-calling agent → Polyp generation: dispatches tools
gradio.py - Tool-calling agent → Polyp removal: dispatches tools
gradio.py - Gradio app → OpenAI model: configures model
gradio.py - Report generation → Classification: calls
endoagent/tools/report_generation.py - Report generation → Detection: calls
endoagent/tools/report_generation.py - Report generation → Segmentation: calls
endoagent/tools/report_generation.py - Report generation → Visual Q&A: calls
endoagent/tools/report_generation.py - Visual Q&A → Classification: checks results
endoagent/tools/vqa.py - Visual Q&A → Detection: checks results
endoagent/tools/vqa.py - Polyp removal → Segmentation: gets lesion mask
endoagent/tools/generation_normal.py - Visual evaluation → Classification: uses tool
evalutaion/visual_tasks/endoagent_reflexion.py - Visual evaluation → Detection: uses tool
evalutaion/visual_tasks/endoagent_reflexion.py - Visual evaluation → Segmentation: uses tool
evalutaion/visual_tasks/endoagent_reflexion.py - Visual evaluation → Visual Q&A: uses tool
evalutaion/visual_tasks/endoagent_reflexion.py - Visual evaluation → Report generation: uses tool
evalutaion/visual_tasks/endoagent_reflexion.py