MingGatsby
commited on
Commit
•
914198c
1
Parent(s):
c4cb2d6
Update app.py
Browse files
app.py
CHANGED
@@ -286,6 +286,9 @@ if uploaded_ct_file is not None:
|
|
286 |
|
287 |
transformed_array = eval_transforms(dicom_array)
|
288 |
|
|
|
|
|
|
|
289 |
# Predict
|
290 |
with torch.no_grad():
|
291 |
outputs = ct_model(image_tensor).sigmoid().to("cpu").numpy()
|
|
|
286 |
|
287 |
transformed_array = eval_transforms(dicom_array)
|
288 |
|
289 |
+
# Convert to PyTorch tensor and move to device
|
290 |
+
image_tensor = transformed_array.clone().detach().unsqueeze(0).to(device)
|
291 |
+
|
292 |
# Predict
|
293 |
with torch.no_grad():
|
294 |
outputs = ct_model(image_tensor).sigmoid().to("cpu").numpy()
|