Spaces:
Sleeping
Sleeping
Update api_server.py
Browse files- api_server.py +5 -4
api_server.py
CHANGED
|
@@ -96,7 +96,7 @@ check_memory_usage()
|
|
| 96 |
# Initialize the Flask application
|
| 97 |
app = Flask(__name__)
|
| 98 |
# Initialize the ClipModel at the start
|
| 99 |
-
clip_model = ClipModel()
|
| 100 |
|
| 101 |
check_memory_usage()
|
| 102 |
|
|
@@ -158,9 +158,10 @@ def predict():
|
|
| 158 |
element_list.append(element)
|
| 159 |
|
| 160 |
for yolo_img in yolo_file: # 每張切圖yolo_img
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
|
|
|
| 164 |
|
| 165 |
# if element_counts[element] > 1: #某隻角色的數量>1
|
| 166 |
# yolo_path = f"{YOLO_DIR}/{message_id}/{element}"
|
|
|
|
| 96 |
# Initialize the Flask application
|
| 97 |
app = Flask(__name__)
|
| 98 |
# Initialize the ClipModel at the start
|
| 99 |
+
# clip_model = ClipModel()
|
| 100 |
|
| 101 |
check_memory_usage()
|
| 102 |
|
|
|
|
| 158 |
element_list.append(element)
|
| 159 |
|
| 160 |
for yolo_img in yolo_file: # 每張切圖yolo_img
|
| 161 |
+
print("yolo _img:", yolo_img)
|
| 162 |
+
#top_k_words.append(clip_model.clip_result(yolo_img)) # CLIP預測3個結果(top_k_words)
|
| 163 |
+
#encoded_images.append(image_to_base64(yolo_img))
|
| 164 |
+
#print(f"**{yolo_img}:{top_k_words}**\n")
|
| 165 |
|
| 166 |
# if element_counts[element] > 1: #某隻角色的數量>1
|
| 167 |
# yolo_path = f"{YOLO_DIR}/{message_id}/{element}"
|