Spaces:
Running
Running
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -20,7 +20,7 @@ st.sidebar.write("contact@patacotron.tech")
|
|
20 |
|
21 |
cnn, vit, zero_shot, autoencoder, svm, iforest, gan = st.tabs(["CNN", "ViT", "Zero-Shot", "Autoencoder", "OC-SVM", 'iForest', 'GAN'])
|
22 |
|
23 |
-
@st.
|
24 |
def predict(_model_list, _weights, _img):
|
25 |
y_gorrito = 0
|
26 |
raw_img = cv2.cvtColor(_img, cv2.COLOR_BGR2RGB)
|
@@ -42,7 +42,7 @@ def multiclass_prediction(classifier): #made for hf zero-shot pipeline results
|
|
42 |
labels = [predict['label'] for predict in classifier if score == predict['score']]
|
43 |
return (labels[0] if len(labels) == 1 else labels, score)
|
44 |
|
45 |
-
@st.
|
46 |
def load_clip():
|
47 |
classifier = pipeline("zero-shot-image-classification", model = 'openai/clip-vit-large-patch14-336')
|
48 |
return classifier
|
|
|
20 |
|
21 |
cnn, vit, zero_shot, autoencoder, svm, iforest, gan = st.tabs(["CNN", "ViT", "Zero-Shot", "Autoencoder", "OC-SVM", 'iForest', 'GAN'])
|
22 |
|
23 |
+
@st.cache_resource
|
24 |
def predict(_model_list, _weights, _img):
|
25 |
y_gorrito = 0
|
26 |
raw_img = cv2.cvtColor(_img, cv2.COLOR_BGR2RGB)
|
|
|
42 |
labels = [predict['label'] for predict in classifier if score == predict['score']]
|
43 |
return (labels[0] if len(labels) == 1 else labels, score)
|
44 |
|
45 |
+
@st.cache_resource
|
46 |
def load_clip():
|
47 |
classifier = pipeline("zero-shot-image-classification", model = 'openai/clip-vit-large-patch14-336')
|
48 |
return classifier
|