# import gradio as gr # import datetime # import random # def detect_theft(frame, lat, lon): # # Simulate detection # is_theft = random.choice([True, False]) # time_detected = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") # if is_theft: # alert = f"🚨 Theft detected at {time_detected}!" # map_embed = f"""""" # return alert, frame, map_embed # else: # return "✅ No theft detected", None, None # with gr.Blocks() as demo: # gr.Markdown("## 🚨 Theft Detection & Live Location Surveillance AI") # with gr.Row(): # cam = gr.Image(label="Upload CCTV Frame / Snapshot", type="pil") # with gr.Column(): # lat = gr.Number(label="Latitude", value=24.8607) # lon = gr.Number(label="Longitude", value=67.0011) # detect_btn = gr.Button("Detect Theft") # alert = gr.Textbox(label="Alert") # captured = gr.Image(label="Thief Frame") # map_html = gr.HTML(label="Live Location Map") # detect_btn.click(fn=detect_theft, inputs=[cam, lat, lon], outputs=[alert, captured, map_html]) # demo.launch() # import gradio as gr # import datetime # def detect_theft(frame, lat, lon): # time_detected = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") # alert = f"🚨 Theft detected at {time_detected}!" # map_embed = f"""""" # return alert, frame, map_embed # with gr.Blocks() as demo: # gr.Markdown("## 🚨 Theft Detection & Live Location Surveillance AI") # with gr.Row(): # cam = gr.Image(label="Upload Thief Image", type="pil") # with gr.Column(): # lat = gr.Number(label="Latitude", value=24.8607) # lon = gr.Number(label="Longitude", value=67.0011) # detect_btn = gr.Button("📍 Show Location on Map") # alert = gr.Textbox(label="Alert") # captured = gr.Image(label="Thief Image") # map_html = gr.HTML(label="Live Location Map") # detect_btn.click(fn=detect_theft, inputs=[cam, lat, lon], outputs=[alert, captured, map_html]) # demo.launch() import gradio as gr import datetime def show_thief_location(image, lat, lon): time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") alert = f"🚨 Theft detected at {time}!" map_embed = f"""
Thief Image: