Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ with col2:
|
|
92 |
|
93 |
mean = processor.image_processor.image_mean
|
94 |
std = processor.image_processor.image_std
|
95 |
-
unnormalized_image = (
|
96 |
unnormalized_image = (unnormalized_image * 255).astype(np.uint8)
|
97 |
unnormalized_image = np.moveaxis(unnormalized_image, 0, -1)
|
98 |
unnormalized_image = Image.fromarray(unnormalized_image)
|
|
|
92 |
|
93 |
mean = processor.image_processor.image_mean
|
94 |
std = processor.image_processor.image_std
|
95 |
+
unnormalized_image = (model_encoding.pixel_values.squeeze().numpy() * np.array(std)[:, None, None]) + np.array(mean)[:, None, None]
|
96 |
unnormalized_image = (unnormalized_image * 255).astype(np.uint8)
|
97 |
unnormalized_image = np.moveaxis(unnormalized_image, 0, -1)
|
98 |
unnormalized_image = Image.fromarray(unnormalized_image)
|