Update app.py
Browse files
app.py
CHANGED
@@ -75,9 +75,9 @@ def load_models():
|
|
75 |
)
|
76 |
pipe.unet_encoder = UNet_Encoder
|
77 |
|
78 |
-
global models_loaded
|
79 |
models_loaded = True
|
80 |
|
|
|
81 |
def pil_to_binary_mask(pil_image, threshold=0):
|
82 |
np_image = np.array(pil_image.convert("L")) # Convert to grayscale directly
|
83 |
binary_mask = np_image > threshold
|
|
|
75 |
)
|
76 |
pipe.unet_encoder = UNet_Encoder
|
77 |
|
|
|
78 |
models_loaded = True
|
79 |
|
80 |
+
|
81 |
def pil_to_binary_mask(pil_image, threshold=0):
|
82 |
np_image = np.array(pil_image.convert("L")) # Convert to grayscale directly
|
83 |
binary_mask = np_image > threshold
|