Initial Seg Data Server Net platform
This commit is contained in:
15
backend/tests/test_catalog.py
Normal file
15
backend/tests/test_catalog.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from app.catalog import SEGMODEL_ARCHS, TASK_TYPES, YOLO_MODELS
|
||||
|
||||
|
||||
def test_catalog_contains_required_capabilities():
|
||||
assert "Unet" in SEGMODEL_ARCHS
|
||||
assert "YOLOv9e-seg" in YOLO_MODELS
|
||||
for task in [
|
||||
"dataset.video_frames",
|
||||
"segmodel.train",
|
||||
"yolo.predict",
|
||||
"mmseg.flops_fps",
|
||||
"analysis.all",
|
||||
]:
|
||||
assert task in TASK_TYPES
|
||||
|
||||
18
backend/tests/test_system_service.py
Normal file
18
backend/tests/test_system_service.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from app.modules.system.service import parse_nvidia_smi_csv
|
||||
|
||||
|
||||
def test_parse_nvidia_smi_csv():
|
||||
output = "0, NVIDIA GeForce RTX 4090, 24564, 15, 24069, 0, 37\n"
|
||||
gpus = parse_nvidia_smi_csv(output)
|
||||
assert gpus == [
|
||||
{
|
||||
"index": 0,
|
||||
"name": "NVIDIA GeForce RTX 4090",
|
||||
"memory_total_mb": 24564,
|
||||
"memory_used_mb": 15,
|
||||
"memory_free_mb": 24069,
|
||||
"utilization_gpu_percent": 0,
|
||||
"temperature_c": 37,
|
||||
}
|
||||
]
|
||||
|
||||
14
backend/tests/test_weights_service.py
Normal file
14
backend/tests/test_weights_service.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from pathlib import Path
|
||||
|
||||
from app.modules.weights.service import classify_weight
|
||||
|
||||
|
||||
def test_classify_weight():
|
||||
item = classify_weight(Path("Seg_All_In_One_YoloModel/yolov8n-seg.pt"))
|
||||
assert item["family"] == "yolo"
|
||||
assert item["role"] == "weight"
|
||||
|
||||
best = classify_weight(Path("Seg_Predict_YoloModel/YOLOv9e-seg/weights/best.pt"))
|
||||
assert best["family"] == "yolo"
|
||||
assert best["role"] == "trained_best"
|
||||
|
||||
Reference in New Issue
Block a user