MAY199 commited on
Commit
26ed0d6
·
verified ·
1 Parent(s): 12332b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -41,6 +41,7 @@ def recommend(img):
41
  results.append(train_ds[int(image_indices[i])]["pixel_values"])
42
  return results
43
 
 
44
  demo = gr.Interface(
45
  fn=recommend,
46
  inputs=gr.Image(type="pil", label="Upload a landscape image"),
@@ -53,14 +54,26 @@ demo = gr.Interface(
53
  description="Upload a landscape image and receive visually similar recommendations."
54
  )
55
 
 
56
  with gr.Blocks() as app:
57
  demo.render()
58
 
59
  gr.Markdown("---")
60
  gr.Markdown("## Project Presentation Video")
61
- gr.Video(value="https://huggingface.co/spaces/MAY199/LANDSCAPE_RECOMMENDER/resolve/main/VIDEO.mp4", format="mp4")
62
-
63
- app.launch()
64
-
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
 
 
41
  results.append(train_ds[int(image_indices[i])]["pixel_values"])
42
  return results
43
 
44
+ # Gradio interface
45
  demo = gr.Interface(
46
  fn=recommend,
47
  inputs=gr.Image(type="pil", label="Upload a landscape image"),
 
54
  description="Upload a landscape image and receive visually similar recommendations."
55
  )
56
 
57
+ # App layout with video below
58
  with gr.Blocks() as app:
59
  demo.render()
60
 
61
  gr.Markdown("---")
62
  gr.Markdown("## Project Presentation Video")
 
 
 
 
63
 
64
+ gr.HTML("""
65
+ <div style="width:100%;max-width:900px;margin:0 auto;">
66
+ <div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:12px;">
67
+ <iframe
68
+ src="https://www.youtube.com/embed/nwbPAR7UApw"
69
+ title="Project presentation"
70
+ frameborder="0"
71
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
72
+ allowfullscreen
73
+ style="position:absolute;top:0;left:0;width:100%;height:100%;">
74
+ </iframe>
75
+ </div>
76
+ </div>
77
+ """)
78
 
79
+ app.launch()