Views
No views yet
1{
2 "model_type": "yolov11-seg",
3 "task": "image-segmentation",
4 "framework": "ultralytics",
5 "num_classes": 2,
6 "id2label": {
7 "0": "Port-capped",
8 "1": "Port-Empty"
9 },
10 "input_size": 1408,
11 "confidence_threshold": 0.25,
12 "iou_threshold": 0.45
13}1from ultralytics import YOLO
2
3# Load model
4model = YOLO('model.pt')
5
6# Run inference
7results = model('image.jpg', conf=0.25, iou=0.45)
8
9# Process results
10for result in results:
11 masks = result.masks # Segmentation masks
12 boxes = result.boxes # Bounding boxes
13
14 # Get class names
15 for box in boxes:
16 class_id = int(box.cls)
17 class_name = {"0": "Port-capped", "1": "Port-Empty"}[str(class_id)]
18 confidence = float(box.conf)
19 print(f"Detected: {class_name} ({confidence:.2f})")
20
21 # Visualize
22 result.show()1import requests
2import json
3
4API_URL = "https://router.huggingface.co/models/Sunix2026/Port-model"
5headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
6
7def query(filename):
8 with open(filename, "rb") as f:
9 data = f.read()
10 response = requests.post(API_URL, headers=headers, data=data)
11 return response.json()
12
13# Run inference
14output = query("image.jpg")
15print(json.dumps(output, indent=2))1from yolov11_hf_inference import YOLOv11HFInference
2
3# Initialize client
4client = YOLOv11HFInference(
5 model_url="Sunix2026/Port-model",
6 access_token="YOUR_HF_TOKEN"
7)
8
9# Run inference
10result = client.predict_from_path("image.jpg")
11
12if result["success"]:
13 predictions = result["predictions"]
14
15 # Map class IDs to names
16 id2label = {"0": "Port-capped", "1": "Port-Empty"}
17
18 for pred in predictions:
19 class_name = id2label.get(str(pred.get('label', '')), 'Unknown')
20 confidence = pred.get('score', 0)
21 print(f"Found: {class_name} ({confidence:.2%})")
22else:
23 print(f"Error: {result['error']}")| Metric | Value |
|---|---|
| Confidence Threshold | 0.25 |
| IoU Threshold | 0.45 |
| Input Resolution | 1408x1408 |
1@misc{Port-model,
2 author = {Sunix2026},
3 title = {Port Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/Sunix2026/Port-model}}
7}