initial commit
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import subprocess
|
2 |
import shlex
|
3 |
import os
|
|
|
4 |
|
5 |
# Clone the repository
|
6 |
subprocess.run(shlex.split("git clone https://github.com/facebookresearch/segment-anything-2.git"))
|
@@ -11,6 +12,28 @@ os.chdir("segment-anything-2")
|
|
11 |
# Install the package
|
12 |
subprocess.run(shlex.split("pip install -e ."))
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# import torch
|
15 |
# from sam2.build_sam import build_sam2
|
16 |
# from sam2.sam2_image_predictor import SAM2ImagePredictor
|
|
|
1 |
import subprocess
|
2 |
import shlex
|
3 |
import os
|
4 |
+
import gradio as gr
|
5 |
|
6 |
# Clone the repository
|
7 |
subprocess.run(shlex.split("git clone https://github.com/facebookresearch/segment-anything-2.git"))
|
|
|
12 |
# Install the package
|
13 |
subprocess.run(shlex.split("pip install -e ."))
|
14 |
|
15 |
+
|
16 |
+
|
17 |
+
def run(image):
|
18 |
+
return None
|
19 |
+
|
20 |
+
|
21 |
+
demo = gr.Interface(
|
22 |
+
fn=run,
|
23 |
+
title="LGM Tiny",
|
24 |
+
description="An extremely simplified version of [LGM](https://huggingface.co/ashawkey/LGM). Intended as resource for the [ML for 3D Course](https://huggingface.co/learn/ml-for-3d-course/unit0/introduction).",
|
25 |
+
inputs="image",
|
26 |
+
outputs=gr.Model3D(),
|
27 |
+
examples=[
|
28 |
+
"https://huggingface.co/datasets/dylanebert/iso3d/resolve/main/jpg@512/a_cat_statue.jpg"
|
29 |
+
],
|
30 |
+
cache_examples=True,
|
31 |
+
allow_duplication=True,
|
32 |
+
)
|
33 |
+
demo.queue().launch()
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
# import torch
|
38 |
# from sam2.build_sam import build_sam2
|
39 |
# from sam2.sam2_image_predictor import SAM2ImagePredictor
|