Spaces:
Running
Running
Upload folder using huggingface_hub
Browse filesFiles changed (2)
- measure_finger.py+16-16
- web_demo/static/app.js+11-2
441 unmodified lines442443444445446447448449450451452453454455456457458459460445446447448449450451452453454455456457458459460461462463441 unmodified lines for pt in _xform(seeds).astype(int): _plus(pt, KEEP_COLOR)
negatives = seed_debug.get("negatives") or [] if negatives: for pt in _xform(negatives).astype(int): _plus(pt, NEG_COLOR)
anchor = seed_debug.get("anchor") if anchor is not None: ax, ay = _xform([anchor])[0].astype(int) # Tilted cross (X) to distinguish the anchor from the plus-shaped seeds. cv2.drawMarker( out, (int(ax), int(ay)), ANCHOR_COLOR, markerType=cv2.MARKER_TILTED_CROSS, markerSize=marker_size, thickness=thickness, line_type=cv2.LINE_AA, ) #negatives = seed_debug.get("negatives") or [] #if negatives: # for pt in _xform(negatives).astype(int): # _plus(pt, NEG_COLOR)
#anchor = seed_debug.get("anchor") #if anchor is not None: # ax, ay = _xform([anchor])[0].astype(int) # # Tilted cross (X) to distinguish the anchor from the plus-shaped seeds. # cv2.drawMarker( # out, (int(ax), int(ay)), ANCHOR_COLOR, # markerType=cv2.MARKER_TILTED_CROSS, # markerSize=marker_size, # thickness=thickness, # line_type=cv2.LINE_AA, # ) return out
242 unmodified lines2432442452462462472482492502512522532482542552562572582 unmodified lines26126226326426526626726826927027127215 unmodified lines288289290291292293294242 unmodified lines};
const runMeasurement = async (endpoint, formData, inputUrlFallback = "") => { setStatus("Measuring… Please wait 5-10 seconds."); const startedAt = Date.now(); const renderElapsed = () => { const secs = Math.floor((Date.now() - startedAt) / 1000); setStatus(`Measuring… Please wait. (${secs}s)`); overallSize.innerHTML = `<div class="size-hero"><span class="size-label">Measuring… ${secs}s</span></div>`; }; renderElapsed(); jsonOutput.textContent = '{\n "status": "processing"\n}'; overallSize.innerHTML = `<div class="size-hero"><span class="size-label">Measuring…</span></div>`; fingerBreakdown.innerHTML = ""; const timerId = setInterval(renderElapsed, 1000);
try { const response = await fetch(endpoint, {2 unmodified lines });
if (!response.ok) { clearInterval(timerId); const error = await response.json(); setStatus(error.error || "Measurement failed", { error: true }); return; } clearInterval(timerId);
const data = await response.json(); jsonOutput.textContent = JSON.stringify(data.result, null, 2);15 unmodified lines setStatus(formatFailReasonStatus(failReason), { error: true }); } } catch (error) { clearInterval(timerId); setStatus("Network error. Please retry.", { error: true }); }};measure_finger.py+16-16
web_demo/static/app.js+11-2