Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,30 +1,13 @@
|
|
| 1 |
# This was made by following this tutorial
|
| 2 |
# https://www.youtube.com/watch?v=i40ulpcacFM
|
| 3 |
|
| 4 |
-
!pip install -U -q segmentation-models
|
| 5 |
-
# # Open the file in write mode
|
| 6 |
-
# with open('/usr/local/lib/python3.9/dist-packages/efficientnet/keras.py', 'r') as f:
|
| 7 |
-
# # Read the contents of the file
|
| 8 |
-
# contents = f.read()
|
| 9 |
-
|
| 10 |
-
# # Replace the string
|
| 11 |
-
# new_contents = contents.replace('init_keras_custom_objects', 'init_tfkeras_custom_objects')
|
| 12 |
-
|
| 13 |
-
# # Open the file in write mode again and write the modified contents
|
| 14 |
-
# with open('/usr/local/lib/python3.9/dist-packages/efficientnet/keras.py', 'w') as f:
|
| 15 |
-
# f.write(new_contents)
|
| 16 |
-
|
| 17 |
-
!pip install patchify
|
| 18 |
-
!pip install gradio
|
| 19 |
-
|
| 20 |
import os
|
| 21 |
from os.path import join as pjoin
|
| 22 |
import cv2
|
| 23 |
import numpy as np
|
| 24 |
from tqdm import tqdm
|
| 25 |
-
|
| 26 |
from PIL import Image
|
| 27 |
-
import seaborn as sns
|
| 28 |
from sklearn.preprocessing import MinMaxScaler, StandardScaler
|
| 29 |
from patchify import patchify, unpatchify
|
| 30 |
|
|
@@ -33,7 +16,6 @@ from keras.models import load_model
|
|
| 33 |
|
| 34 |
import segmentation_models as sm
|
| 35 |
|
| 36 |
-
|
| 37 |
import gradio as gr
|
| 38 |
|
| 39 |
def jaccard_coef(y_true, y_pred):
|
|
|
|
| 1 |
# This was made by following this tutorial
|
| 2 |
# https://www.youtube.com/watch?v=i40ulpcacFM
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import os
|
| 5 |
from os.path import join as pjoin
|
| 6 |
import cv2
|
| 7 |
import numpy as np
|
| 8 |
from tqdm import tqdm
|
| 9 |
+
|
| 10 |
from PIL import Image
|
|
|
|
| 11 |
from sklearn.preprocessing import MinMaxScaler, StandardScaler
|
| 12 |
from patchify import patchify, unpatchify
|
| 13 |
|
|
|
|
| 16 |
|
| 17 |
import segmentation_models as sm
|
| 18 |
|
|
|
|
| 19 |
import gradio as gr
|
| 20 |
|
| 21 |
def jaccard_coef(y_true, y_pred):
|