Downloads · 30 days
2
3% of all-time downloads
Sunix2026/Port-model
Port-model is a object detection model from Sunix2026. 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.
This is a custom trained YOLOv11 segmentation model for port detection.
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
70
Public
Repo size
131 MB
Likes
0
Public
Click a slice to open those files.
.pt125 MB · 100%
From the Hugging Face model README
This is a custom trained YOLOv11 segmentation model for port detection.
{
"model_type": "yolov11-seg",
"task": "image-segmentation",
"framework": "ultralytics",
"num_classes": 2,
"id2label": {
"0": "Port-capped",
"1": "Port-Empty"
},
"input_size": 1408,
"confidence_threshold": 0.25,
"iou_threshold": 0.45
}
from ultralytics import YOLO
# Load model
model = YOLO('model.pt')
# Run inference
results = model('image.jpg', conf=0.25, iou=0.45)
# Process results
for result in results:
masks = result.masks # Segmentation masks
boxes = result.boxes # Bounding boxes
# Get class names
for box in boxes:
class_id = int(box.cls)
class_name = {"0": "Port-capped", "1": "Port-Empty"}[str(class_id)]
confidence = float(box.conf)
print(f"Detected: {class_name} ({confidence:.2f})")
# Visualize
result.show()
import requests
import json
API_URL = "https://router.huggingface.co/models/Sunix2026/Port-model"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
# Run inference
output = query("image.jpg")
print(json.dumps(output, indent=2))
from yolov11_hf_inference import YOLOv11HFInference
# Initialize client
client = YOLOv11HFInference(
model_url="Sunix2026/Port-model",
access_token="YOUR_HF_TOKEN"
)
# Run inference
result = client.predict_from_path("image.jpg")
if result["success"]:
predictions = result["predictions"]
# Map class IDs to names
id2label = {"0": "Port-capped", "1": "Port-Empty"}
for pred in predictions:
class_name = id2label.get(str(pred.get('label', '')), 'Unknown')
confidence = pred.get('score', 0)
print(f"Found: {class_name} ({confidence:.2%})")
else:
print(f"Error: {result['error']}")
| Metric | Value |
|---|---|
| Confidence Threshold | 0.25 |
| IoU Threshold | 0.45 |
| Input Resolution | 1408x1408 |
This model can be used for:
AGPL-3.0
If you use this model, please cite:
@misc{Port-model,
author = {Sunix2026},
title = {Port Model},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Sunix2026/Port-model}}
}