Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def upload_images(image_paths):
|
|
17 |
for i in range(len(image_paths)):
|
18 |
df.loc[i] = [str(i+1), image_paths[i].split("/")[-1], predict(image_paths[i])]
|
19 |
docs.append([str(i+1), image_paths[i].split("/")[-1], predict(image_paths[i])])
|
20 |
-
return [df, gr.Button(visible=True), gr.DownloadButton(
|
21 |
|
22 |
# Function to preprocess image and predict
|
23 |
def predict(image_path):
|
@@ -53,7 +53,7 @@ with gr.Blocks() as demo:
|
|
53 |
f = gr.File(file_count="multiple", file_types=[".jpg", ".jpeg", ".png", ".bmp", ".tif", ".tiff"])
|
54 |
u = gr.Button("Upload files", visible=True)
|
55 |
d1 = gr.DownloadButton("Generate report", visible=True)
|
56 |
-
d2 = gr.DownloadButton("
|
57 |
r = gr.DataFrame(headers=["Index", "File", "Result"])
|
58 |
|
59 |
u.click(upload_images, f, [r, u, d1])
|
|
|
17 |
for i in range(len(image_paths)):
|
18 |
df.loc[i] = [str(i+1), image_paths[i].split("/")[-1], predict(image_paths[i])]
|
19 |
docs.append([str(i+1), image_paths[i].split("/")[-1], predict(image_paths[i])])
|
20 |
+
return [df, gr.Button(visible=True), gr.DownloadButton(visible=True), gr.DownloadButton(visible=False)]
|
21 |
|
22 |
# Function to preprocess image and predict
|
23 |
def predict(image_path):
|
|
|
53 |
f = gr.File(file_count="multiple", file_types=[".jpg", ".jpeg", ".png", ".bmp", ".tif", ".tiff"])
|
54 |
u = gr.Button("Upload files", visible=True)
|
55 |
d1 = gr.DownloadButton("Generate report", visible=True)
|
56 |
+
d2 = gr.DownloadButton("Download report", visible=False)
|
57 |
r = gr.DataFrame(headers=["Index", "File", "Result"])
|
58 |
|
59 |
u.click(upload_images, f, [r, u, d1])
|