One photo → figure ID + MSRP / Market prices.
Local desktop app for Apple Silicon. Not for public deployment.
- Upload a figure photo (file, camera, or drag & drop)
- Match it against a local vector index (~12k figures from MFC)
- Optionally re-rank with Gemini, or fall back to Gemini + Google Search
- Show MSRP and partner asking prices in KRW
Requirements: macOS (Apple Silicon), Python 3.11, Gemini API key (free tier OK)
brew install python@3.11
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# set GEMINI_API_KEY=...If data/figures.db is already present, run the app:
source .venv/bin/activate
python -m gui
# or: ./run.sh / double-click FigurePrice.commandSkip if you already have data/figures.db.
source .venv/bin/activate
python -m db.init_db
python -m crawler.fx_updater
python -m crawler.mfc_crawler --max-items 500 # raise or omit for full crawl
python -m embeddings.build_index # ~1h for ~12k on MPSUseful crawl flags: --refresh, --refresh-existing, --seeds URL...
| Variable | Default | Notes |
|---|---|---|
GEMINI_API_KEY |
(required) | Free key from AI Studio |
GEMINI_MODEL |
gemini-3.1-flash-lite |
Re-rank |
GEMINI_LOOKUP_SEARCH_MODEL |
gemini-2.5-flash |
Web lookup + Search (higher free-tier Search quota) |
GEMINI_LOOKUP_MODEL |
gemini-3.1-flash-lite |
Offline lookup fallback |
GEMINI_LOOKUP_USE_SEARCH |
true |
Set false to skip Search grounding |
DATA_DIR |
./data |
DB + image cache |
flowchart LR
A[Photo] --> B[rembg]
B --> C[DINOv2 · MPS]
C --> D[sqlite-vec top-K]
D --> E{Match?}
E -->|yes| F[Gemini re-rank<br/>optional]
E -->|miss| G[Gemini + Google Search]
F --> H[MSRP + quotes → KRW]
G --> H
Stack: PySide6 GUI · DINOv2 · sqlite-vec · Gemini · MFC crawl
Optional HTTP API (same pipeline): uvicorn api.main:app --port 8000 → docs at /docs
| Issue | Fix |
|---|---|
| First identify is slow (~30–60s) | One-time DINOv2 / u2net download |
torchvision import error |
pip install torchvision |
| MFC 403/503 | Wait, then raise MFC_REQUEST_DELAY_SEC in config.py |
| Gemini 429 | Wait for RPM, or switch models in .env / try next day |
Unique constraint on figure_images |
python -m db.migrate_figure_images (once) |
- Personal / research use only — do not redistribute crawled images
- Crawl respects a polite delay (
MFC_REQUEST_DELAY_SEC)

