Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -45,19 +45,42 @@ ci = Interrogator(config)
|
|
45 |
def inference(image, mode, best_max_flavors):
|
46 |
image = image.convert('RGB')
|
47 |
if mode == 'best':
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
49 |
prompt_result = ci.interrogate(image, max_flavors=int(best_max_flavors))
|
|
|
50 |
print(prompt_result)
|
|
|
51 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
|
|
52 |
elif mode == 'classic':
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
54 |
prompt_result = ci.interrogate_classic(image)
|
|
|
55 |
print(prompt_result)
|
|
|
56 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
|
|
57 |
else:
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
59 |
prompt_result = ci.interrogate_fast(image)
|
|
|
60 |
print(prompt_result)
|
|
|
61 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
62 |
|
63 |
title = """
|
|
|
45 |
def inference(image, mode, best_max_flavors):
|
46 |
image = image.convert('RGB')
|
47 |
if mode == 'best':
|
48 |
+
|
49 |
+
print("""ββββ
|
50 |
+
new inference
|
51 |
+
mode: best
|
52 |
+
""")
|
53 |
+
|
54 |
prompt_result = ci.interrogate(image, max_flavors=int(best_max_flavors))
|
55 |
+
|
56 |
print(prompt_result)
|
57 |
+
|
58 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
59 |
+
|
60 |
elif mode == 'classic':
|
61 |
+
|
62 |
+
print("""ββββ
|
63 |
+
new inference
|
64 |
+
mode: classic
|
65 |
+
""")
|
66 |
+
|
67 |
prompt_result = ci.interrogate_classic(image)
|
68 |
+
|
69 |
print(prompt_result)
|
70 |
+
|
71 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
72 |
+
|
73 |
else:
|
74 |
+
|
75 |
+
print("""ββββ
|
76 |
+
new inference
|
77 |
+
mode: best
|
78 |
+
""")
|
79 |
+
|
80 |
prompt_result = ci.interrogate_fast(image)
|
81 |
+
|
82 |
print(prompt_result)
|
83 |
+
|
84 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
85 |
|
86 |
title = """
|