file('image'); $pct = SkinAiService::predict($image); $threshold = config('ai.threshold'); $labelPos = config('ai.label_positive'); $labelNeg = config('ai.label_negative'); $label = is_numeric($pct) ? ($pct >= $threshold ? $labelPos : $labelNeg) : null; return response()->json([ 'percentage' => $pct, 'diagnosisAi' => $label, ]); } }