Skip to content

Commit a8a04ec

Browse files
28nitin07claude
andcommitted
fix(scan): expand saveable categories to all 5 v3 classes, log not_clothing scores
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e27fd91 commit a8a04ec

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

backend/app/services/clothing_detector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def detect(image_rgb: np.ndarray) -> DetectionResult:
6161
primary = categories[0] if categories else "not_clothing"
6262

6363
if not is_clothing:
64+
import logging
65+
logging.getLogger("rizzvision").info(
66+
"not_clothing — scores: %s", {k: f"{v:.3f}" for k, v in scores.items()}
67+
)
6468
raise ImageQualityError(
6569
"not_clothing",
6670
"This app only accepts clothing items. Please point the camera at a garment and try again.",

frontend/src/screens/ScanScreen.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export function ScanScreen() {
4141
try {
4242
const result = await quickScan(blob)
4343
const cat = (result.category || '').toLowerCase()
44-
if (cat !== 'tops' && cat !== 'bottoms') {
45-
const msg = `This looks like ${result.suggested_name || cat || 'an item'}. Only tops and bottoms can be saved to your wardrobe.`
44+
const SAVEABLE = ['tops', 'bottoms', 'footwear', 'outerwear', 'dress']
45+
if (!SAVEABLE.includes(cat)) {
46+
const msg = `This app only accepts clothing items. This looks like ${result.suggested_name || 'a non-clothing item'}.`
4647
setErrorMsg(msg)
4748
speak(msg)
4849
setPhase('not_clothing')
@@ -177,7 +178,7 @@ export function ScanScreen() {
177178
// ── Not Clothing ──
178179
if (phase === 'not_clothing') {
179180
return (
180-
<Screen title="Cannot Save" subtitle="Only tops and bottoms can be added to your wardrobe.">
181+
<Screen title="Cannot Save" subtitle="Only clothing items can be added to your wardrobe.">
181182
{previewUrl && <img src={previewUrl} alt="" style={{ width: '100%', borderRadius: COLORS.RADIUS, marginBottom: 20, maxHeight: 280, objectFit: 'cover', opacity: 0.45, border: `2px solid ${COLORS.BORDER}` }} />}
182183
<div role="alert" style={{ border: `2px solid ${COLORS.BORDER}`, borderRadius: COLORS.RADIUS, padding: 18, marginBottom: 20, background: COLORS.SURFACE }}>
183184
<p style={{ fontSize: 15, color: COLORS.TEXT, lineHeight: 1.7, margin: 0 }}>{errorMsg}</p>

0 commit comments

Comments
 (0)