Downloads · 30 days
329
59% of all-time downloads
BitcrushedHeart/bmd_watermark_n
bmd_watermark_n is a object detection model from BitcrushedHeart. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as agpl-3.0.
A lightweight YOLO11-nano model fine-tuned for detecting watermarks in images. Trained from scratch on a custom dataset of real-world watermarked images, designed to power the smart-crop watermark removal pipeline in…
Downloads · 30 days
329
59% of all-time downloads
All-time downloads
557
Public
Repo size
5.4 MB
Likes
0
Public
Click a slice to open those files.
.pt5.4 MB · 100%
From the Hugging Face model README
bmd_watermark_n.ptA lightweight YOLO11-nano model fine-tuned for detecting watermarks in images. Trained from scratch on a custom dataset of real-world watermarked images, designed to power the smart-crop watermark removal pipeline in DatasetStudio.
The n 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 |
This model is intended to detect the location of watermarks in images so that a downstream cropping step can remove them cleanly. It is well-suited for:
[!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 pillow
from ultralytics import YOLO
model = YOLO("bmd_watermark_n.pt")
results = model("your_image.jpg", conf=0.25)
for r in results:
for box in r.boxes:
print(f"Watermark detected at {box.xyxy[0].tolist()} (conf: {float(box.conf[0]):.2f})")
from ultralytics import YOLO
model = YOLO("bmd_watermark_n.pt")
image_paths = ["img1.jpg", "img2.jpg", "img3.png"]
results = model(image_paths, conf=0.25, verbose=False)
for path, r in zip(image_paths, results):
if len(r.boxes) > 0:
print(f"{path}: watermark found")
else:
print(f"{path}: clean")
from ultralytics import YOLO
from PIL import Image
def crop_out_watermark(img_path, model, conf=0.25, padding=0.1):
results = model(img_path, conf=conf, verbose=False)
r = results[0]
img_w, img_h = r.orig_shape[1], r.orig_shape[0]
if len(r.boxes) == 0:
return Image.open(img_path) # No watermark, return as-is
# Find largest detected box
best_box = max(r.boxes, key=lambda b: (b.xyxy[0][2]-b.xyxy[0][0]) * (b.xyxy[0][3]-b.xyxy[0][1]))
x1, y1, x2, y2 = best_box.xyxy[0].tolist()
# Add padding
pw = (x2 - x1) * padding
ph = (y2 - y1) * padding
x1, y1, x2, y2 = max(0,x1-pw), max(0,y1-ph), min(img_w,x2+pw), min(img_h,y2+ph)
# Crop to the largest region not containing the watermark
candidates = [
(0, 0, img_w, int(y1)), # above
(0, int(y2), img_w, img_h), # below
(0, 0, int(x1), img_h), # left
(int(x2), 0, img_w, img_h), # right
]
best = max(candidates, key=lambda c: (c[2]-c[0]) * (c[3]-c[1]))
img = Image.open(img_path)
return img.crop(best)
model = YOLO("bmd_watermark_n.pt")
clean = crop_out_watermark("watermarked.jpg", model)
clean.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.This model is released under the AGPL-3.0 License, consistent with the Ultralytics YOLO11 framework used for training.
If you use this model in a commercial product or networked service, you must either comply with AGPL-3.0 (open-source your application) or obtain a separate commercial license from Ultralytics for the underlying framework.