Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
class_building = '#3C1098'
|
| 2 |
class_building = class_building.lstrip('#')
|
| 3 |
class_building = np.array(tuple(int(class_building[i:i+2], 16) for i in (0,2,4)))
|
|
@@ -22,25 +39,6 @@ class_unlabeled = '#9B9B9B'
|
|
| 22 |
class_unlabeled = class_unlabeled.lstrip('#')
|
| 23 |
class_unlabeled = np.array(tuple(int(class_unlabeled[i:i+2], 16) for i in (0,2,4)))
|
| 24 |
|
| 25 |
-
|
| 26 |
-
import gradio as gr
|
| 27 |
-
import os
|
| 28 |
-
import cv2
|
| 29 |
-
from PIL import Image
|
| 30 |
-
import numpy as np
|
| 31 |
-
from matplotlib import pyplot as plt
|
| 32 |
-
import random
|
| 33 |
-
from keras.utils import get_custom_objects
|
| 34 |
-
import os
|
| 35 |
-
|
| 36 |
-
#os.environ['SM_FRAMEWORK'] = 'tf.keras'
|
| 37 |
-
|
| 38 |
-
import segmentation_models as sm
|
| 39 |
-
|
| 40 |
-
from keras import backend as K
|
| 41 |
-
from keras.models import load_model
|
| 42 |
-
|
| 43 |
-
|
| 44 |
def jaccard_coef(y_true, y_pred):
|
| 45 |
y_true_flatten = K.flatten(y_true)
|
| 46 |
y_pred_flatten = K.flatten(y_pred)
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
import cv2
|
| 4 |
+
from PIL import Image
|
| 5 |
+
import numpy as np
|
| 6 |
+
from matplotlib import pyplot as plt
|
| 7 |
+
import random
|
| 8 |
+
from keras.utils import get_custom_objects
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
+
#os.environ['SM_FRAMEWORK'] = 'tf.keras'
|
| 12 |
+
|
| 13 |
+
import segmentation_models as sm
|
| 14 |
+
|
| 15 |
+
from keras import backend as K
|
| 16 |
+
from keras.models import load_model
|
| 17 |
+
|
| 18 |
class_building = '#3C1098'
|
| 19 |
class_building = class_building.lstrip('#')
|
| 20 |
class_building = np.array(tuple(int(class_building[i:i+2], 16) for i in (0,2,4)))
|
|
|
|
| 39 |
class_unlabeled = class_unlabeled.lstrip('#')
|
| 40 |
class_unlabeled = np.array(tuple(int(class_unlabeled[i:i+2], 16) for i in (0,2,4)))
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
def jaccard_coef(y_true, y_pred):
|
| 43 |
y_true_flatten = K.flatten(y_true)
|
| 44 |
y_pred_flatten = K.flatten(y_pred)
|