Spaces:
Sleeping
Sleeping
File size: 801 Bytes
50b877f 12a862b cc1e001 abf113e 7df50ed cc1e001 abf113e 7df50ed cc1e001 7df50ed cc1e001 7df50ed abf113e 12a862b 50b877f 70b33ad 7df50ed 50b877f 656ff4b 12a862b 49e9380 7df50ed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import gradio as gr
import numpy as np
import similarSearch
import pandas as pd
df = pd.read_csv('./gallery.csv')
# Function to find similar image IDs for a newly updated image
def find_similar_images(new_image):
# Placeholder for your code to find similar image IDs based on the new_image
similar_ids = similarSearch.predict(new_image) # Replace with the actual logic for finding similar IDs
print(similar_ids)
return similar_ids
# Define Gradio interface
iface = gr.Interface(
fn=find_similar_images,
inputs=gr.inputs.Image(label="Upload Image"),
outputs=gr.outputs.JSON(label="Similar Image IDs"),
title="Image Similarity Finder",
description="Upload an image to find similar image IDs in the database."
)
# Launch the Gradio interface
iface.launch()
|