Date time added
Browse files
app.py
CHANGED
|
@@ -89,10 +89,11 @@ trclip = Trclip(model_path, clip_model='ViT-L/14', device='cpu')
|
|
| 89 |
# %%
|
| 90 |
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
# %%
|
| 94 |
def run_im(im1, use_trcap_images, text1, use_trcap_texts):
|
| 95 |
-
print(f'INFO :
|
| 96 |
f_texts_embeddings = None
|
| 97 |
ims = None
|
| 98 |
if use_trcap_images:
|
|
@@ -140,7 +141,7 @@ def run_im(im1, use_trcap_images, text1, use_trcap_texts):
|
|
| 140 |
|
| 141 |
|
| 142 |
def run_text(im1, use_trcap_images, text1, use_trcap_texts):
|
| 143 |
-
print(f'INFO :
|
| 144 |
f_image_embeddings = None
|
| 145 |
ims = None
|
| 146 |
if use_trcap_images:
|
|
@@ -281,7 +282,7 @@ with gr.Blocks() as demo:
|
|
| 281 |
with gr.Tabs():
|
| 282 |
with gr.TabItem("Use Own Images"):
|
| 283 |
im_input = gr.components.File(label="Image input", optional=True, file_count='multiple')
|
| 284 |
-
is_trcap_ims = gr.Checkbox(label="Use TRCaption Images\n[Note: Random 2 sample selected in text retrieval mode
|
| 285 |
|
| 286 |
with gr.Tabs():
|
| 287 |
with gr.TabItem("Input a text (Seperated by new line Max 2 for Image retrieval)"):
|
|
|
|
| 89 |
# %%
|
| 90 |
|
| 91 |
|
| 92 |
+
import datetime
|
| 93 |
|
| 94 |
# %%
|
| 95 |
def run_im(im1, use_trcap_images, text1, use_trcap_texts):
|
| 96 |
+
print(f'{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")} INFO : Image retrieval starting')
|
| 97 |
f_texts_embeddings = None
|
| 98 |
ims = None
|
| 99 |
if use_trcap_images:
|
|
|
|
| 141 |
|
| 142 |
|
| 143 |
def run_text(im1, use_trcap_images, text1, use_trcap_texts):
|
| 144 |
+
print(f'{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")} INFO : Text retrieval starting')
|
| 145 |
f_image_embeddings = None
|
| 146 |
ims = None
|
| 147 |
if use_trcap_images:
|
|
|
|
| 282 |
with gr.Tabs():
|
| 283 |
with gr.TabItem("Use Own Images"):
|
| 284 |
im_input = gr.components.File(label="Image input", optional=True, file_count='multiple')
|
| 285 |
+
is_trcap_ims = gr.Checkbox(label="Use TRCaption Images\n[Note: Random 2 sample selected in text retrieval mode]")
|
| 286 |
|
| 287 |
with gr.Tabs():
|
| 288 |
with gr.TabItem("Input a text (Seperated by new line Max 2 for Image retrieval)"):
|