Views
No views yet
bmd_watermark_n.ptn suffix denotes the nano variant — optimised for fast batch inference on large image datasets without sacrificing meaningful detection accuracy.| Property | Value |
|---|---|
| Architecture | YOLO11n (nano) |
| Task | Object Detection |
| Input | RGB images (any resolution — resized to 640×640 internally) |
| Output | Bounding boxes (xyxy) + confidence scores |
| Classes | 0: watermark |
| License | AGPL-3.0 |
[!WARNING] This model is intended for legitimate dataset cleaning use cases (e.g. removing watermarks from your own content). Do not use it to strip copyright protections from images you do not have the rights to modify.
pip install ultralytics pillow1from ultralytics import YOLO
2
3model = YOLO("bmd_watermark_n.pt")
4
5results = model("your_image.jpg", conf=0.25)
6for r in results:
7 for box in r.boxes:
8 print(f"Watermark detected at {box.xyxy[0].tolist()} (conf: {float(box.conf[0]):.2f})")1from ultralytics import YOLO
2
3model = YOLO("bmd_watermark_n.pt")
4
5image_paths = ["img1.jpg", "img2.jpg", "img3.png"]
6results = model(image_paths, conf=0.25, verbose=False)
7
8for path, r in zip(image_paths, results):
9 if len(r.boxes) > 0:
10 print(f"{path}: watermark found")
11 else:
12 print(f"{path}: clean")1from ultralytics import YOLO
2from PIL import Image
3
4def crop_out_watermark(img_path, model, conf=0.25, padding=0.1):
5 results = model(img_path, conf=conf, verbose=False)
6 r = results[0]
7 img_w, img_h = r.orig_shape[1], r.orig_shape[0]
8
9 if len(r.boxes) == 0:
10 return Image.open(img_path) # No watermark, return as-is
11
12 # Find largest detected box
13 best_box = max(r.boxes, key=lambda b: (b.xyxy[0][2]-b.xyxy[0][0]) * (b.xyxy[0][3]-b.xyxy[0][1]))
14 x1, y1, x2, y2 = best_box.xyxy[0].tolist()
15
16 # Add padding
17 pw = (x2 - x1) * padding
18 ph = (y2 - y1) * padding
19 x1, y1, x2, y2 = max(0,x1-pw), max(0,y1-ph), min(img_w,x2+pw), min(img_h,y2+ph)
20
21 # Crop to the largest region not containing the watermark
22 candidates = [
23 (0, 0, img_w, int(y1)), # above
24 (0, int(y2), img_w, img_h), # below
25 (0, 0, int(x1), img_h), # left
26 (int(x2), 0, img_w, img_h), # right
27 ]
28 best = max(candidates, key=lambda c: (c[2]-c[0]) * (c[3]-c[1]))
29
30 img = Image.open(img_path)
31 return img.crop(best)
32
33model = YOLO("bmd_watermark_n.pt")
34clean = crop_out_watermark("watermarked.jpg", model)
35clean.save("clean.jpg")class x_center y_center width height)0.25 for single-image preview, 0.5 for batch processings or m size variant.