Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,399 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
from pathlib import Path
|
| 3 |
-
from typing import List, Union
|
| 4 |
-
from PIL import Image
|
| 5 |
-
import ezdxf.units
|
| 6 |
-
import numpy as np
|
| 7 |
-
import torch
|
| 8 |
-
from torchvision import transforms
|
| 9 |
-
from ultralytics import YOLOWorld, YOLO
|
| 10 |
-
from ultralytics.engine.results import Results
|
| 11 |
-
from ultralytics.utils.plotting import save_one_box
|
| 12 |
-
from transformers import AutoModelForImageSegmentation
|
| 13 |
-
import cv2
|
| 14 |
-
import ezdxf
|
| 15 |
-
import gradio as gr
|
| 16 |
-
import gc
|
| 17 |
-
from scalingtestupdated import calculate_scaling_factor
|
| 18 |
-
from scipy.interpolate import splprep, splev
|
| 19 |
-
from scipy.ndimage import gaussian_filter1d
|
| 20 |
-
|
| 21 |
-
birefnet = AutoModelForImageSegmentation.from_pretrained(
|
| 22 |
-
"zhengpeng7/BiRefNet", trust_remote_code=True
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
device = "cpu"
|
| 26 |
-
torch.set_float32_matmul_precision(["high", "highest"][0])
|
| 27 |
-
|
| 28 |
-
birefnet.to(device)
|
| 29 |
-
birefnet.eval()
|
| 30 |
-
transform_image = transforms.Compose(
|
| 31 |
-
[
|
| 32 |
-
transforms.Resize((1024, 1024)),
|
| 33 |
-
transforms.ToTensor(),
|
| 34 |
-
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
|
| 35 |
-
]
|
| 36 |
-
)
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
def remove_bg(image: np.ndarray) -> np.ndarray:
|
| 41 |
-
image = Image.fromarray(image)
|
| 42 |
-
input_images = transform_image(image).unsqueeze(0).to("cpu")
|
| 43 |
-
|
| 44 |
-
# Prediction
|
| 45 |
-
with torch.no_grad():
|
| 46 |
-
preds = birefnet(input_images)[-1].sigmoid().cpu()
|
| 47 |
-
pred = preds[0].squeeze()
|
| 48 |
-
|
| 49 |
-
# Show Results
|
| 50 |
-
pred_pil: Image = transforms.ToPILImage()(pred)
|
| 51 |
-
print(pred_pil)
|
| 52 |
-
# Scale proportionally with max length to 1024 for faster showing
|
| 53 |
-
scale_ratio = 1024 / max(image.size)
|
| 54 |
-
scaled_size = (int(image.size[0] * scale_ratio), int(image.size[1] * scale_ratio))
|
| 55 |
-
|
| 56 |
-
return np.array(pred_pil.resize(scaled_size))
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
def make_square(img: np.ndarray):
|
| 60 |
-
# Get dimensions
|
| 61 |
-
height, width = img.shape[:2]
|
| 62 |
-
|
| 63 |
-
# Find the larger dimension
|
| 64 |
-
max_dim = max(height, width)
|
| 65 |
-
|
| 66 |
-
# Calculate padding
|
| 67 |
-
pad_height = (max_dim - height) // 2
|
| 68 |
-
pad_width = (max_dim - width) // 2
|
| 69 |
-
|
| 70 |
-
# Handle odd dimensions
|
| 71 |
-
pad_height_extra = max_dim - height - 2 * pad_height
|
| 72 |
-
pad_width_extra = max_dim - width - 2 * pad_width
|
| 73 |
-
|
| 74 |
-
# Create padding with edge colors
|
| 75 |
-
if len(img.shape) == 3: # Color image
|
| 76 |
-
# Pad the image
|
| 77 |
-
padded = np.pad(
|
| 78 |
-
img,
|
| 79 |
-
(
|
| 80 |
-
(pad_height, pad_height + pad_height_extra),
|
| 81 |
-
(pad_width, pad_width + pad_width_extra),
|
| 82 |
-
(0, 0),
|
| 83 |
-
),
|
| 84 |
-
mode="edge",
|
| 85 |
-
)
|
| 86 |
-
else: # Grayscale image
|
| 87 |
-
padded = np.pad(
|
| 88 |
-
img,
|
| 89 |
-
(
|
| 90 |
-
(pad_height, pad_height + pad_height_extra),
|
| 91 |
-
(pad_width, pad_width + pad_width_extra),
|
| 92 |
-
),
|
| 93 |
-
mode="edge",
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
return padded
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
def exclude_scaling_box(
|
| 100 |
-
image: np.ndarray,
|
| 101 |
-
bbox: np.ndarray,
|
| 102 |
-
orig_size: tuple,
|
| 103 |
-
processed_size: tuple,
|
| 104 |
-
expansion_factor: float = 1.5,
|
| 105 |
-
) -> np.ndarray:
|
| 106 |
-
# Unpack the bounding box
|
| 107 |
-
x_min, y_min, x_max, y_max = map(int, bbox)
|
| 108 |
-
|
| 109 |
-
# Calculate scaling factors
|
| 110 |
-
scale_x = processed_size[1] / orig_size[1] # Width scale
|
| 111 |
-
scale_y = processed_size[0] / orig_size[0] # Height scale
|
| 112 |
-
|
| 113 |
-
# Adjust bounding box coordinates
|
| 114 |
-
x_min = int(x_min * scale_x)
|
| 115 |
-
x_max = int(x_max * scale_x)
|
| 116 |
-
y_min = int(y_min * scale_y)
|
| 117 |
-
y_max = int(y_max * scale_y)
|
| 118 |
-
|
| 119 |
-
# Calculate expanded box coordinates
|
| 120 |
-
box_width = x_max - x_min
|
| 121 |
-
box_height = y_max - y_min
|
| 122 |
-
expanded_x_min = max(0, int(x_min - (expansion_factor - 1) * box_width / 2))
|
| 123 |
-
expanded_x_max = min(
|
| 124 |
-
image.shape[1], int(x_max + (expansion_factor - 1) * box_width / 2)
|
| 125 |
-
)
|
| 126 |
-
expanded_y_min = max(0, int(y_min - (expansion_factor - 1) * box_height / 2))
|
| 127 |
-
expanded_y_max = min(
|
| 128 |
-
image.shape[0], int(y_max + (expansion_factor - 1) * box_height / 2)
|
| 129 |
-
)
|
| 130 |
-
|
| 131 |
-
# Black out the expanded region
|
| 132 |
-
image[expanded_y_min:expanded_y_max, expanded_x_min:expanded_x_max] = 0
|
| 133 |
-
|
| 134 |
-
return image
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
def resample_contour(contour):
|
| 138 |
-
# ---------------------------------------------------------------------------------------- #
|
| 139 |
-
# Get all the parameters at the start:
|
| 140 |
-
num_points = 1000
|
| 141 |
-
smoothing_factor = 5
|
| 142 |
-
|
| 143 |
-
smoothed_x_sigma = 1
|
| 144 |
-
smoothed_y_sigma = 1
|
| 145 |
-
# ---------------------------------------------------------------------------------------- #
|
| 146 |
-
contour = contour[:, 0, :]
|
| 147 |
-
|
| 148 |
-
tck, _ = splprep([contour[:, 0], contour[:, 1]], s=smoothing_factor)
|
| 149 |
-
|
| 150 |
-
u = np.linspace(0, 1, num_points)
|
| 151 |
-
resampled_points = splev(u, tck)
|
| 152 |
-
|
| 153 |
-
smoothed_x = gaussian_filter1d(resampled_points[0], sigma=smoothed_x_sigma)
|
| 154 |
-
smoothed_y = gaussian_filter1d(resampled_points[1], sigma=smoothed_y_sigma)
|
| 155 |
-
|
| 156 |
-
return np.array([smoothed_x, smoothed_y]).T
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
def save_dxf_spline(inflated_contours, scaling_factor, height):
|
| 160 |
-
# ---------------------------------------------------------------------------------------- #
|
| 161 |
-
# Get all the parameters at the start:
|
| 162 |
-
degree = 3
|
| 163 |
-
closed = True
|
| 164 |
-
# ---------------------------------------------------------------------------------------- #
|
| 165 |
-
|
| 166 |
-
doc = ezdxf.new(units=0)
|
| 167 |
-
doc.units = ezdxf.units.IN
|
| 168 |
-
doc.header["$INSUNITS"] = ezdxf.units.IN
|
| 169 |
-
|
| 170 |
-
msp = doc.modelspace()
|
| 171 |
-
|
| 172 |
-
for contour in inflated_contours:
|
| 173 |
-
resampled_contour = resample_contour(contour)
|
| 174 |
-
points = [
|
| 175 |
-
(x * scaling_factor, (height - y) * scaling_factor)
|
| 176 |
-
for x, y in resampled_contour
|
| 177 |
-
]
|
| 178 |
-
if len(points) >= 3:
|
| 179 |
-
# Manually Closing the Contour in case it hasn't been closed by the contours before.
|
| 180 |
-
if np.linalg.norm(np.array(points[0]) - np.array(points[-1])) > 1e-2:
|
| 181 |
-
points.append(points[0])
|
| 182 |
-
|
| 183 |
-
spline = msp.add_spline(points, degree=degree)
|
| 184 |
-
spline.closed = closed
|
| 185 |
-
|
| 186 |
-
# Step 14: Save the DXF file
|
| 187 |
-
dxf_filepath = os.path.join("./outputs", "out.dxf")
|
| 188 |
-
doc.saveas(dxf_filepath)
|
| 189 |
-
return dxf_filepath
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
def extract_outlines(binary_image: np.ndarray) -> np.ndarray:
|
| 193 |
-
"""
|
| 194 |
-
Extracts and draws the outlines of masks from a binary image.
|
| 195 |
-
Args:
|
| 196 |
-
binary_image: Grayscale binary image where white represents masks and black is the background.
|
| 197 |
-
Returns:
|
| 198 |
-
Image with outlines drawn.
|
| 199 |
-
"""
|
| 200 |
-
# Detect contours from the binary image
|
| 201 |
-
contours, _ = cv2.findContours(
|
| 202 |
-
binary_image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE
|
| 203 |
-
)
|
| 204 |
-
|
| 205 |
-
# smooth_contours_list = []
|
| 206 |
-
# for contour in contours:
|
| 207 |
-
# smooth_contours_list.append(smooth_contours(contour))
|
| 208 |
-
# Create a blank image to draw contours
|
| 209 |
-
outline_image = np.zeros_like(binary_image)
|
| 210 |
-
|
| 211 |
-
# Draw the contours on the blank image
|
| 212 |
-
cv2.drawContours(
|
| 213 |
-
outline_image, contours, -1, (255), thickness=1
|
| 214 |
-
) # White color for outlines
|
| 215 |
-
|
| 216 |
-
return cv2.bitwise_not(outline_image), contours
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
def shrink_bbox(image: np.ndarray, shrink_factor: float):
|
| 220 |
-
"""
|
| 221 |
-
Crops the central 80% of the image, maintaining proportions for non-square images.
|
| 222 |
-
Args:
|
| 223 |
-
image: Input image as a NumPy array.
|
| 224 |
-
Returns:
|
| 225 |
-
Cropped image as a NumPy array.
|
| 226 |
-
"""
|
| 227 |
-
height, width = image.shape[:2]
|
| 228 |
-
center_x, center_y = width // 2, height // 2
|
| 229 |
-
|
| 230 |
-
# Calculate 80% dimensions
|
| 231 |
-
new_width = int(width * shrink_factor)
|
| 232 |
-
new_height = int(height * shrink_factor)
|
| 233 |
-
|
| 234 |
-
# Determine the top-left and bottom-right points for cropping
|
| 235 |
-
x1 = max(center_x - new_width // 2, 0)
|
| 236 |
-
y1 = max(center_y - new_height // 2, 0)
|
| 237 |
-
x2 = min(center_x + new_width // 2, width)
|
| 238 |
-
y2 = min(center_y + new_height // 2, height)
|
| 239 |
-
|
| 240 |
-
# Crop the image
|
| 241 |
-
cropped_image = image[y1:y2, x1:x2]
|
| 242 |
-
return cropped_image
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
def to_dxf(contours):
|
| 246 |
-
doc = ezdxf.new()
|
| 247 |
-
msp = doc.modelspace()
|
| 248 |
-
|
| 249 |
-
for contour in contours:
|
| 250 |
-
points = [(point[0][0], point[0][1]) for point in contour]
|
| 251 |
-
msp.add_lwpolyline(points, close=True) # Add a polyline for each contour
|
| 252 |
-
|
| 253 |
-
doc.saveas("./outputs/out.dxf")
|
| 254 |
-
return "./outputs/out.dxf"
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
def smooth_contours(contour):
|
| 258 |
-
epsilon = 0.01 * cv2.arcLength(contour, True) # Adjust factor (e.g., 0.01)
|
| 259 |
-
return cv2.approxPolyDP(contour, epsilon, True)
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
def scale_image(image: np.ndarray, scale_factor: float) -> np.ndarray:
|
| 263 |
-
"""
|
| 264 |
-
Resize image by scaling both width and height by the same factor.
|
| 265 |
-
|
| 266 |
-
Args:
|
| 267 |
-
image: Input numpy image
|
| 268 |
-
scale_factor: Factor to scale the image (e.g., 0.5 for half size, 2 for double size)
|
| 269 |
-
|
| 270 |
-
Returns:
|
| 271 |
-
np.ndarray: Resized image
|
| 272 |
-
"""
|
| 273 |
-
if scale_factor <= 0:
|
| 274 |
-
raise ValueError("Scale factor must be positive")
|
| 275 |
-
|
| 276 |
-
current_height, current_width = image.shape[:2]
|
| 277 |
-
|
| 278 |
-
# Calculate new dimensions
|
| 279 |
-
new_width = int(current_width * scale_factor)
|
| 280 |
-
new_height = int(current_height * scale_factor)
|
| 281 |
-
|
| 282 |
-
# Choose interpolation method based on whether we're scaling up or down
|
| 283 |
-
interpolation = cv2.INTER_AREA if scale_factor < 1 else cv2.INTER_CUBIC
|
| 284 |
-
|
| 285 |
-
# Resize image
|
| 286 |
-
resized_image = cv2.resize(
|
| 287 |
-
image, (new_width, new_height), interpolation=interpolation
|
| 288 |
-
)
|
| 289 |
-
|
| 290 |
-
return resized_image
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
def detect_reference_square(img) -> np.ndarray:
|
| 294 |
-
box_detector = YOLO("./best.pt")
|
| 295 |
-
res = box_detector.predict(img)
|
| 296 |
-
del box_detector
|
| 297 |
-
return save_one_box(res[0].cpu().boxes.xyxy, res[0].orig_img, save=False), res[
|
| 298 |
-
0
|
| 299 |
-
].cpu().boxes.xyxy[0]
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
def resize_img(img: np.ndarray, resize_dim):
|
| 303 |
-
return np.array(Image.fromarray(img).resize(resize_dim))
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
def predict(image, offset_inches):
|
| 307 |
-
|
| 308 |
-
# Detect the scaling reference square
|
| 309 |
-
try:
|
| 310 |
-
reference_obj_img, scaling_box_coords = detect_reference_square(image)
|
| 311 |
-
except:
|
| 312 |
-
raise gr.Error("Unable to DETECT COIN, please take another picture with different magnification level!")
|
| 313 |
-
|
| 314 |
-
# reference_obj_img_scaled = shrink_bbox(reference_obj_img, 1.2)
|
| 315 |
-
# make the image sqaure so it does not effect the size of objects
|
| 316 |
-
reference_obj_img = make_square(reference_obj_img)
|
| 317 |
-
reference_square_mask = remove_bg(reference_obj_img)
|
| 318 |
-
|
| 319 |
-
# make the mask same size as org image
|
| 320 |
-
reference_square_mask = resize_img(
|
| 321 |
-
reference_square_mask, (reference_obj_img.shape[1], reference_obj_img.shape[0])
|
| 322 |
-
)
|
| 323 |
-
|
| 324 |
-
try:
|
| 325 |
-
scaling_factor = calculate_scaling_factor(
|
| 326 |
-
reference_image_path="./coin.png",
|
| 327 |
-
target_image=reference_square_mask,
|
| 328 |
-
feature_detector="ORB",
|
| 329 |
-
)
|
| 330 |
-
except:
|
| 331 |
-
scaling_factor = 1.0
|
| 332 |
-
|
| 333 |
-
# Save original size before `remove_bg` processing
|
| 334 |
-
orig_size = image.shape[:2]
|
| 335 |
-
# Generate foreground mask and save its size
|
| 336 |
-
objects_mask = remove_bg(image)
|
| 337 |
-
|
| 338 |
-
processed_size = objects_mask.shape[:2]
|
| 339 |
-
# Exclude scaling box region from objects mask
|
| 340 |
-
objects_mask = exclude_scaling_box(
|
| 341 |
-
objects_mask,
|
| 342 |
-
scaling_box_coords,
|
| 343 |
-
orig_size,
|
| 344 |
-
processed_size,
|
| 345 |
-
expansion_factor=3.0,
|
| 346 |
-
)
|
| 347 |
-
objects_mask = resize_img(
|
| 348 |
-
objects_mask, (image.shape[1], image.shape[0])
|
| 349 |
-
)
|
| 350 |
-
offset_pixels = (offset_inches / scaling_factor) * 2 + 1
|
| 351 |
-
dilated_mask = cv2.dilate(
|
| 352 |
-
objects_mask, np.ones((int(offset_pixels), int(offset_pixels)), np.uint8)
|
| 353 |
-
)
|
| 354 |
-
|
| 355 |
-
# Scale the object mask according to scaling factor
|
| 356 |
-
# objects_mask_scaled = scale_image(objects_mask, scaling_factor)
|
| 357 |
-
Image.fromarray(dilated_mask).save("./outputs/scaled_mask_new.jpg")
|
| 358 |
-
outlines, contours = extract_outlines(dilated_mask)
|
| 359 |
-
shrunked_img_contours = cv2.drawContours(
|
| 360 |
-
image, contours, -1, (0, 0, 255), thickness=2
|
| 361 |
-
)
|
| 362 |
-
dxf = save_dxf_spline(contours, scaling_factor, processed_size[0])
|
| 363 |
-
|
| 364 |
-
return (
|
| 365 |
-
cv2.cvtColor(shrunked_img_contours, cv2.COLOR_BGR2RGB),
|
| 366 |
-
outlines,
|
| 367 |
-
dxf,
|
| 368 |
-
dilated_mask,
|
| 369 |
-
scaling_factor,
|
| 370 |
-
)
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
if __name__ == "__main__":
|
| 374 |
-
os.makedirs("./outputs", exist_ok=True)
|
| 375 |
-
|
| 376 |
-
ifer = gr.Interface(
|
| 377 |
-
fn=predict,
|
| 378 |
-
inputs=[
|
| 379 |
-
gr.Image(label="Input Image"),
|
| 380 |
-
gr.Number(label="Offset value for Mask(inches)", value=0.075),
|
| 381 |
-
],
|
| 382 |
-
outputs=[
|
| 383 |
-
gr.Image(label="Ouput Image"),
|
| 384 |
-
gr.Image(label="Outlines of Objects"),
|
| 385 |
-
gr.File(label="DXF file"),
|
| 386 |
-
gr.Image(label="Mask"),
|
| 387 |
-
gr.Textbox(
|
| 388 |
-
label="Scaling Factor(mm)",
|
| 389 |
-
placeholder="Every pixel is equal to mentioned number in inches",
|
| 390 |
-
),
|
| 391 |
-
],
|
| 392 |
-
examples=[
|
| 393 |
-
["./examples/Test20.jpg", 0.075],
|
| 394 |
-
["./examples/Test21.jpg", 0.075],
|
| 395 |
-
["./examples/Test22.jpg", 0.075],
|
| 396 |
-
["./examples/Test23.jpg", 0.075],
|
| 397 |
-
],
|
| 398 |
-
)
|
| 399 |
-
ifer.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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