Update app.py
Browse files
app.py
CHANGED
@@ -54,17 +54,18 @@ class model:
|
|
54 |
|
55 |
to_tensor = T.ToTensor()
|
56 |
|
57 |
-
|
58 |
|
59 |
if protein_image:
|
60 |
-
|
61 |
-
stacked_images = torch.stack([
|
62 |
processed_images = process_image(stacked_images, dataset)
|
63 |
nucleus_image = processed_images[0].unsqueeze(0)
|
64 |
protein_image = processed_images[1].unsqueeze(0)
|
65 |
protein_image = protein_image > 0
|
66 |
protein_image = 1.0 * protein_image
|
67 |
else:
|
|
|
68 |
protein_image = torch.ones((256, 256))
|
69 |
|
70 |
threshold, heatmap = run_image_prediction(
|
|
|
54 |
|
55 |
to_tensor = T.ToTensor()
|
56 |
|
57 |
+
nucleus_image = to_tensor(nucleus_image)
|
58 |
|
59 |
if protein_image:
|
60 |
+
protein_image = to_tensor(protein_image)
|
61 |
+
stacked_images = torch.stack([nucleus_image, protein_image], dim=0)
|
62 |
processed_images = process_image(stacked_images, dataset)
|
63 |
nucleus_image = processed_images[0].unsqueeze(0)
|
64 |
protein_image = processed_images[1].unsqueeze(0)
|
65 |
protein_image = protein_image > 0
|
66 |
protein_image = 1.0 * protein_image
|
67 |
else:
|
68 |
+
nucleus_image = process_image(nucleus_image)
|
69 |
protein_image = torch.ones((256, 256))
|
70 |
|
71 |
threshold, heatmap = run_image_prediction(
|