Update app.py
Browse files
app.py
CHANGED
|
@@ -70,11 +70,11 @@ def predict_skin(input_image):
|
|
| 70 |
])
|
| 71 |
tensor_in = transform(img).unsqueeze(0).to(DEVICE)
|
| 72 |
|
| 73 |
-
# 2. Inférence de l'IA
|
| 74 |
with torch.no_grad():
|
| 75 |
tensor_out = model(tensor_in).squeeze(0).cpu()
|
| 76 |
|
| 77 |
-
# 3. Post-traitement
|
| 78 |
tensor_out = torch.clamp(tensor_out, 0, 1)
|
| 79 |
skin_pil = transforms.ToPILImage()(tensor_out)
|
| 80 |
skin_final = skin_pil.resize((SKIN_SIZE, SKIN_SIZE), Image.Resampling.NEAREST)
|
|
|
|
| 70 |
])
|
| 71 |
tensor_in = transform(img).unsqueeze(0).to(DEVICE)
|
| 72 |
|
| 73 |
+
# 2. Inférence brute et stricte de l'IA
|
| 74 |
with torch.no_grad():
|
| 75 |
tensor_out = model(tensor_in).squeeze(0).cpu()
|
| 76 |
|
| 77 |
+
# 3. Post-traitement minimal (Uniquement l'écrêtage obligatoire pour convertir en image PIL)
|
| 78 |
tensor_out = torch.clamp(tensor_out, 0, 1)
|
| 79 |
skin_pil = transforms.ToPILImage()(tensor_out)
|
| 80 |
skin_final = skin_pil.resize((SKIN_SIZE, SKIN_SIZE), Image.Resampling.NEAREST)
|