fd7585acc5
Sostituisce GUI cv2/tkinter con webapp standalone:
Server (pm2d/web/server.py):
- FastAPI + uvicorn
- Endpoint: GET /, POST /upload, POST /match, POST /auto_tune,
GET /image/{id}/raw
- In-memory image store (uuid-based)
- Rendering annotated server-side via opencv (overlay bbox + edges
template warpati)
Frontend (pm2d/web/static/):
- index.html: layout 3 colonne (MODELLO | SCENA | PARAMETRI) + footer
legenda
- style.css: tema dark, CSS grid responsive
- app.js: canvas HTML5 per visualizzazione scalata fit,
ROI selection con drag mouse, form parametri live,
MATCH button, Auto-tune button
Parametri modificabili INLINE (niente dialog separata).
Enter su qualsiasi campo triggera MATCH.
Legenda match in fondo con pallino colorato + dati.
main.py ora lancia il server webapp. Deprecato ingresso GUI cv2
(pm2d/gui.py resta importable per backward compat).
Test: /match su rings_and_nuts: 3/3 ruote in 1.14s (train 0.36s + find 0.77s).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
101 lines
2.6 KiB
CSS
101 lines
2.6 KiB
CSS
* { box-sizing: border-box; }
|
|
html, body {
|
|
margin: 0; padding: 0; background: #1a1a1a; color: #dcdcdc;
|
|
font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
font-size: 14px;
|
|
min-height: 100vh;
|
|
}
|
|
header {
|
|
background: #111; padding: 10px 16px; border-bottom: 1px solid #333;
|
|
position: sticky; top: 0; z-index: 10;
|
|
}
|
|
header h1 {
|
|
margin: 0 0 8px; font-size: 18px; color: #00c8ff;
|
|
}
|
|
.toolbar {
|
|
display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
|
|
}
|
|
.btn {
|
|
display: inline-block; padding: 6px 14px; background: #2c2c2c;
|
|
border: 1px solid #444; color: #dcdcdc; cursor: pointer;
|
|
border-radius: 4px; font-size: 13px; line-height: 1.4;
|
|
transition: background 0.15s;
|
|
}
|
|
.btn:hover { background: #3a3a3a; }
|
|
.btn-go {
|
|
background: #0a7d3a; border-color: #0d9c48; color: #fff; font-weight: bold;
|
|
}
|
|
.btn-go:hover { background: #0d9c48; }
|
|
#status {
|
|
color: #00c8ff; margin-left: 12px; font-weight: 500;
|
|
}
|
|
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 420px 1fr 360px;
|
|
gap: 12px;
|
|
padding: 12px 16px;
|
|
}
|
|
.col {
|
|
background: #232323; padding: 10px;
|
|
border: 1px solid #333; border-radius: 4px;
|
|
}
|
|
.col h2 {
|
|
margin: 0 0 8px; font-size: 13px; color: #00c8ff;
|
|
letter-spacing: 1px; text-transform: uppercase;
|
|
}
|
|
.canvas-wrap {
|
|
background: #141414; border: 1px solid #444;
|
|
display: inline-block; position: relative;
|
|
}
|
|
canvas {
|
|
display: block; cursor: crosshair;
|
|
image-rendering: pixelated;
|
|
}
|
|
#roi-info {
|
|
margin-top: 6px; font-size: 12px; color: #aaa;
|
|
}
|
|
|
|
#params-form {
|
|
display: grid; grid-template-columns: 1fr 100px; gap: 4px 8px;
|
|
}
|
|
#params-form label {
|
|
font-size: 12px; display: flex; align-items: center;
|
|
}
|
|
#params-form input {
|
|
background: #2a2a2a; color: #dcdcdc; border: 1px solid #444;
|
|
padding: 4px 6px; border-radius: 3px; font-size: 12px;
|
|
width: 100%;
|
|
}
|
|
#params-form input:focus { outline: 1px solid #00c8ff; }
|
|
|
|
.kv {
|
|
display: flex; justify-content: space-between;
|
|
padding: 3px 0; font-size: 12px; border-bottom: 1px dotted #333;
|
|
}
|
|
.kv span:last-child { color: #80ff80; font-weight: bold; }
|
|
|
|
footer {
|
|
padding: 10px 16px; border-top: 1px solid #333;
|
|
min-height: 120px;
|
|
}
|
|
footer h2 {
|
|
margin: 0 0 8px; font-size: 13px; color: #00c8ff;
|
|
letter-spacing: 1px; text-transform: uppercase;
|
|
}
|
|
#legend {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
gap: 6px;
|
|
}
|
|
.legend-item {
|
|
display: flex; align-items: center; gap: 8px;
|
|
padding: 4px 6px; background: #232323;
|
|
border-radius: 3px; font-size: 12px; font-family: monospace;
|
|
}
|
|
.legend-dot {
|
|
width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
|
|
}
|
|
|
|
#col-model, #col-scene { min-width: 0; }
|