Update app.py
Browse files
app.py
CHANGED
|
@@ -191,9 +191,10 @@ def mask_rembg(input_img):
|
|
| 191 |
def process_image(input_img):
|
| 192 |
|
| 193 |
rotated = False
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
|
|
|
| 197 |
input_img = cv2.resize(input_img, (640, 480))
|
| 198 |
mask, rgb = mask_rembg(input_img)
|
| 199 |
depth_dict = depth_moge(input_img)
|
|
@@ -205,6 +206,14 @@ def process_image(input_img):
|
|
| 205 |
# print(input_glb)
|
| 206 |
return input_glb, inference_glb
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
demo = gr.Interface(
|
| 209 |
process_image,
|
| 210 |
gr.Image(),
|
|
|
|
| 191 |
def process_image(input_img):
|
| 192 |
|
| 193 |
rotated = False
|
| 194 |
+
if input_img.shape[0] > input_img.shape[1]:
|
| 195 |
+
input_img = cv2.rotate(input_img, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
| 196 |
+
rotated = True
|
| 197 |
+
|
| 198 |
input_img = cv2.resize(input_img, (640, 480))
|
| 199 |
mask, rgb = mask_rembg(input_img)
|
| 200 |
depth_dict = depth_moge(input_img)
|
|
|
|
| 206 |
# print(input_glb)
|
| 207 |
return input_glb, inference_glb
|
| 208 |
|
| 209 |
+
gr.Markdown("""
|
| 210 |
+
## Image to 3D in cluttered scene with [RaySt3R](https://rayst3r.github.io/)
|
| 211 |
+
* Upload an image and click submit.
|
| 212 |
+
* We mask the input using [Rembg](https://github.com/danielgatis/rembg) and generate depth with [MoGe](https://github.com/microsoft/MoGe).
|
| 213 |
+
* The input point cloud will be visible in 'input', the output is visible in the "RaySt3R" section.
|
| 214 |
+
|
| 215 |
+
[Project Website](https://rayst3r.github.io/)
|
| 216 |
+
""")
|
| 217 |
demo = gr.Interface(
|
| 218 |
process_image,
|
| 219 |
gr.Image(),
|