Spaces:
Running on Zero
Running on Zero
Commit History
Today
-
Update app.py Running
Verified signature0efbac7 -
Update app.py
Verified signature41c9330 -
Update app.py
Verified signaturecf12bbe -
Update app.py
Verified signature39c97f2 -
Update app.py
Verified signature931fa5d -
Update app.py
Verified signature7598b9f -
Update app.py
Verified signaturea15cb8b -
Update app.py
Verified signatureca0df08
6 days ago
-
Update app.py
Verified signature9483dec -
Update app.py
Verified signature3c377ed -
Update app.py
Verified signature0b6f56b -
Update app.py
Verified signaturee40ce7e -
Update app.py
Verified signatureb8d8580 -
Update app.py
Verified signature570f550 -
Update app.py
Verified signature7c21a79 -
Update app.py
Verified signaturebe357e4 -
Update app.py
Verified signature2610306 -
Update app.py
Verified signaturee9f31c5 -
Update app.py
Verified signaturebfb98c8 -
Update app.py
Verified signature77798ce -
Update app.py
Verified signature41b6608 -
Update app.py
Verified signature7c7f2e8 -
Update app.py
Verified signature299b4fb -
Update app.py
Verified signature94a8352 -
Update app.py
Verified signature2ea7e08 -
Update app.py
Verified signatureaec4fce -
Update app.py
Verified signature074bf36 -
Create app.py
Verified signatureea755cd -
app.py
Verified signatureimport cv2 import gradio as gr import numpy as np import torch from PIL import Image from transformers import pipeline device = 0 if torch.cuda.is_available() else -1 # Load free open-weights vision models seg_pipe = pipeline( "image-segmentation", model="nvidia/segformer-b2-finetuned-ade-512-512", device=device, ) depth_pipe = pipeline( "depth-estimation", model="depth-anything/Depth-Anything-V2-Small-hf", device=device, ) def fit_structural_lines(edge_map, min_len=60): lines = cv2.HoughLinesP( edge_map, rho=1, theta=np.pi / 180, threshold=50, minLineLength=min_len, maxLineGap=20, ) return lines if lines is not None else [] def line_intersection(l1, l2): # Homogeneous cross product: p = l1 x l2 x1, y1, x2, y2 = l1 x3, y3, x4, y4 = l2 p1 = np.cross([x1, y1, 1.0], [x2, y2, 1.0]) p2 = np.cross([x3, y3, 1.0], [x4, y4, 1.0]) pt = np.cross(p1, p2) if abs(pt[2]) < 1e-6: …e001d7c -
app.py
Verified signature!pip install -q transformers torch torchvision opencv-python-headless scipy gradio pillow import cv2 import numpy as np import torch import gradio as gr from PIL import Image from transformers import pipeline device = 0 if torch.cuda.is_available() else -1 # Load free open-weights models seg_pipe = pipeline( "image-segmentation", model="nvidia/segformer-b2-finetuned-ade-512-512", device=device, ) depth_pipe = pipeline( "depth-estimation", model="depth-anything/Depth-Anything-V2-Small-hf", device=device, ) def fit_structural_lines(edge_map, min_len=60): lines = cv2.HoughLinesP( edge_map, rho=1, theta=np.pi / 180, threshold=50, minLineLength=min_len, maxLineGap=20 ) return lines if lines is not None else [] def line_intersection(l1, l2): # Homogeneous cross product: p = l1 x l2 x1, y1, x2, y2 = l1 x3, y3, x4, y4 = l2 p1 = np.cross([x1, y1, 1.0], [x2, y2, 1.0]) p2 = np.cross([x3, y3, 1.0], [x4, y4, 1.0]) pt =…f1c00ca -
initial commit
Verified signatureb8b4103