Spaces:
Runtime error
Runtime error
Commit Β·
58a97e3
1
Parent(s): 2e7c2d1
Update app.py
Browse files11 unmodified lines1213141516171827 unmodified lines4647484950515264 unmodified lines11711811912012112212312455 unmodified lines18018118218318418511 unmodified linesimport tensorflow as tfimport gradio as grfrom huggingface_hub.keras_mixin import from_pretrained_keras#Function that predicts on only 1 sampledef predict_sample(image):27 unmodified linesreturn inputmodel= from_pretrained_keras("tareknaous/unet-visual-clustering")def get_instances(prediction, data, max_filter_size=1):#Adjust format (clusters to be 255 and rest is 0)64 unmodified linesreturn cluster_idsimport gradio as grfrom itertools import cycle, islicedef visual_clustering(cluster_type, num_clusters, num_samples, random_state, median_kernel_size, max_kernel_size):55 unmodified linesplt.close()return fig1, fig2iface = gr.Interface(11 unmodified lines1213141516171827 unmodified lines46474849505164 unmodified lines11611711811912012112255 unmodified lines17817918018118218318418511 unmodified linesimport tensorflow as tfimport gradio as grfrom huggingface_hub.keras_mixin import from_pretrained_kerasfrom itertools import cycle, islice#Function that predicts on only 1 sampledef predict_sample(image):27 unmodified linesreturn inputdef get_instances(prediction, data, max_filter_size=1):#Adjust format (clusters to be 255 and rest is 0)64 unmodified linesreturn cluster_idsdef visual_clustering(cluster_type, num_clusters, num_samples, random_state, median_kernel_size, max_kernel_size):55 unmodified linesplt.close()return fig1, fig2model= from_pretrained_keras("tareknaous/unet-visual-clustering")iface = gr.Interface(
app.py+4-4