Spaces:
Build error
Build error
tareknaous
commited on
Commit
·
58a97e3
1
Parent(s):
2e7c2d1
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ import numpy as np
|
|
12 |
import tensorflow as tf
|
13 |
import gradio as gr
|
14 |
from huggingface_hub.keras_mixin import from_pretrained_keras
|
15 |
-
|
16 |
|
17 |
#Function that predicts on only 1 sample
|
18 |
def predict_sample(image):
|
@@ -46,7 +46,6 @@ def create_input_image(data, visualize=False):
|
|
46 |
return input
|
47 |
|
48 |
|
49 |
-
model= from_pretrained_keras("tareknaous/unet-visual-clustering")
|
50 |
|
51 |
def get_instances(prediction, data, max_filter_size=1):
|
52 |
#Adjust format (clusters to be 255 and rest is 0)
|
@@ -117,8 +116,7 @@ def get_instances(prediction, data, max_filter_size=1):
|
|
117 |
return cluster_ids
|
118 |
|
119 |
|
120 |
-
|
121 |
-
from itertools import cycle, islice
|
122 |
|
123 |
|
124 |
def visual_clustering(cluster_type, num_clusters, num_samples, random_state, median_kernel_size, max_kernel_size):
|
@@ -180,6 +178,8 @@ def visual_clustering(cluster_type, num_clusters, num_samples, random_state, med
|
|
180 |
plt.close()
|
181 |
|
182 |
return fig1, fig2
|
|
|
|
|
183 |
|
184 |
iface = gr.Interface(
|
185 |
|
|
|
12 |
import tensorflow as tf
|
13 |
import gradio as gr
|
14 |
from huggingface_hub.keras_mixin import from_pretrained_keras
|
15 |
+
from itertools import cycle, islice
|
16 |
|
17 |
#Function that predicts on only 1 sample
|
18 |
def predict_sample(image):
|
|
|
46 |
return input
|
47 |
|
48 |
|
|
|
49 |
|
50 |
def get_instances(prediction, data, max_filter_size=1):
|
51 |
#Adjust format (clusters to be 255 and rest is 0)
|
|
|
116 |
return cluster_ids
|
117 |
|
118 |
|
119 |
+
|
|
|
120 |
|
121 |
|
122 |
def visual_clustering(cluster_type, num_clusters, num_samples, random_state, median_kernel_size, max_kernel_size):
|
|
|
178 |
plt.close()
|
179 |
|
180 |
return fig1, fig2
|
181 |
+
|
182 |
+
model= from_pretrained_keras("tareknaous/unet-visual-clustering")
|
183 |
|
184 |
iface = gr.Interface(
|
185 |
|