How zeyi-lin/hivisionidphotos works
HivisionIDPhoto turns an uploaded portrait into standardized ID photos, with optional background replacement, beauty adjustments, print layouts, watermarks, and template photos. The main UI flow is Gradio → processor → ID-photo creator → downloadable outputs; a CLI and API provide additional entry points. Face detection and matting are selectable, including an optional online Face++ detector. The creator’s orchestration and API implementation were not sampled, so those links reflect the documented product flow; unsampled subsystem details are kept at their supported paths.
Main entry points: processor.py Demo processor · __init__.py ID photo creator · inference.py Inference CLI · choose_handler.py Model selection
Components 19
User interfaces
- Gradio demo
app.py - Demo controls
demo/ui.py - Demo processor
demo/processor.py - Inference CLI
inference.py
Photo creation
- ID photo creator
hivision/__init__.py - Processing context
hivision/creator/context.py - Photo adjustment
hivision/creator/photo_adjuster.py
Enhancement and layout
- Print layout
hivision/creator/layout_calculator.py - Beauty filters
hivision/plugin/beauty/handler.py - Watermarking
hivision/plugin/watermark.py - Template photos
hivision/plugin/template/template_calculator.py
Vision models
- Model selection
hivision/creator/choose_handler.py - Portrait matting
hivision/creator/human_matting.py - Face detection
hivision/creator/face_detector.py - RetinaFace inference
hivision/creator/retinaface/inference.py
API service
- API service
deploy_api.py
Other components
- Photo user
- Face++ API
- Photo files
Connections 25
- Photo user → Gradio demo: uploads photo
- Gradio demo → Demo controls: builds interface
- Demo controls → Demo processor: dispatches inputs
- Demo processor → ID photo creator: creates photo
- Photo user → Inference CLI: provides image
- Inference CLI → ID photo creator: creates photo
- Photo user → API service: sends request
- API service → ID photo creator: requests processing
- Demo processor → Model selection: selects models
- Inference CLI → Model selection: selects models
- Model selection → Portrait matting: selects handler
- Model selection → Face detection: selects handler
- Face detection → RetinaFace inference: runs inference
- Face detection → Face++ API: calls online detector
- ID photo creator → Processing context: maintains state
- ID photo creator → Portrait matting: extracts portrait
- ID photo creator → Face detection: detects face
- ID photo creator → Photo adjustment: adjusts portrait
- Demo processor → Beauty filters: applies filters
- Demo processor → Print layout: builds print layout
- Demo processor → Watermarking: adds watermark
- Demo processor → Template photos: generates template
- Demo processor → Photo files: saves results
- Inference CLI → Print layout: builds print layout
- Inference CLI → Photo files: saves results