How rishitak-cloud/frameagent works
FrameAgent is a Streamlit photography-composition adviser. A photographer uploads an image; the web app constructs composition analysis, which obtains a subject mask and centroid, evaluates composition rules, optionally suggests a crop, and separately requests a NIMA aesthetic score. The app presents annotated rule images, verdicts, and scores. The README identifies web.py as the launch path; the sampled web_v2.py excerpt describes a revised interface, but its omitted analysis code limits tracing its internal wiring. The graph follows the inspected str/web.py and str/composition_rules.py implementation.
Main entry points: composition_rules.py Rule analysis · web.py Streamlit app · nima_import.py NIMA scoring · u2net.py U²-Net mask
Components 16
User interface
- Streamlit app
str/web.py - Uploaded photo
Composition analysis
- Rule analysis
str/composition_rules.py - Subject centroid
str/composition_rules.py - Thirds check
str/composition_rules.py - Golden ratio check
str/composition_rules.py - Centre check
str/composition_rules.py - Symmetry check
str/composition_rules.py - Leading lines check
str/composition_rules.py
Model scoring
- U²-Net mask
str/u2net.py - NIMA scoring
str/nima_import.py
Guidance and results
- Crop suggestion
str/composition_rules.py - Annotated results
str/web.py
Other components
- Photographer
- rembg model
- pyiqa metric
Connections 21
- Photographer → Streamlit app: uploads photo
- Streamlit app → Uploaded photo: reads upload
- Streamlit app → Rule analysis: runs checks
- Rule analysis → U²-Net mask: requests mask
- U²-Net mask → rembg model: removes background
- U²-Net mask → Rule analysis: returns mask
- Rule analysis → Subject centroid: derives centroid
- Rule analysis → Thirds check: checks position
- Rule analysis → Golden ratio check: checks position
- Rule analysis → Centre check: checks position
- Rule analysis → Symmetry check: compares halves
- Rule analysis → Leading lines check: detects diagonals
- Streamlit app → Crop suggestion: requests if eligible
- Streamlit app → NIMA scoring: requests score
- NIMA scoring → pyiqa metric: creates metric
- pyiqa metric → NIMA scoring: returns score
- Rule analysis → Streamlit app: returns checks
- Crop suggestion → Streamlit app: returns crop
- NIMA scoring → Streamlit app: returns score
- Streamlit app → Annotated results: renders results
- Annotated results → Photographer: shows guidance