SkalskiP commited on
Commit
725f958
1 Parent(s): 8e58417

Initial commit :tada:

Browse files
Files changed (4) hide show
  1. .gitignore +1 -0
  2. README.md +2 -2
  3. app.py +29 -0
  4. requirements.txt +8 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ venv/
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: EfficientSAM
3
- emoji: 👁
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
 
1
  ---
2
+ title: EfficientSAM vs SAM
3
+ emoji: ⚔️
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import gradio as gr
3
+
4
+ MARKDOWN = """
5
+ # EfficientSAM sv. SAM
6
+ """
7
+
8
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
+
10
+
11
+ def inference(image):
12
+ return image
13
+
14
+
15
+ with gr.Blocks() as demo:
16
+ gr.Markdown(MARKDOWN)
17
+ with gr.Row():
18
+ input_image = gr.Image()
19
+ output_image = gr.Image()
20
+ with gr.Row():
21
+ submit_button = gr.Button("Submit")
22
+
23
+ submit_button.click(
24
+ inference,
25
+ inputs=[input_image],
26
+ outputs=output_image
27
+ )
28
+
29
+ demo.launch(debug=False, show_error=True)
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu118
2
+ torch
3
+ torchvision
4
+
5
+ gradio
6
+ transformers
7
+ supervision
8
+ gradio-imageslider