Fix import paths for metrics evaluation - corrected relative imports and client class names
Browse files- metrics_evaluation/cvat_api/annotations.py +1 -1
- metrics_evaluation/cvat_api/jobs.py +1 -1
- metrics_evaluation/cvat_api/labels.py +1 -1
- metrics_evaluation/cvat_api/projects.py +2 -2
- metrics_evaluation/cvat_api/tasks.py +2 -2
- metrics_evaluation/extraction/cvat_extractor.py +3 -3
- metrics_evaluation/run_evaluation.py +6 -6
metrics_evaluation/cvat_api/annotations.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
-
from
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
+
from metrics_evaluation.schema.cvat import CvatApiJobList, CvatApiTaskList
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
metrics_evaluation/cvat_api/jobs.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
-
from
|
| 6 |
CvatApiJobDetails,
|
| 7 |
CvatApiJobMediasMetainformation,
|
| 8 |
CvatApiJobsListRequest,
|
|
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
+
from metrics_evaluation.schema.cvat import (
|
| 6 |
CvatApiJobDetails,
|
| 7 |
CvatApiJobMediasMetainformation,
|
| 8 |
CvatApiJobsListRequest,
|
metrics_evaluation/cvat_api/labels.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
-
from
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
+
from metrics_evaluation.schema.cvat import CvatApiLabelDefinition
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
metrics_evaluation/cvat_api/projects.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
-
from
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
@@ -98,7 +98,7 @@ class ProjectsMethods:
|
|
| 98 |
Returns:
|
| 99 |
List of job IDs
|
| 100 |
"""
|
| 101 |
-
from
|
| 102 |
|
| 103 |
headers = self.client._get_headers(token)
|
| 104 |
url = f"{self.client.cvat_host}/api/jobs?project_id={project_id}&page_size=1000&org={self.client.cvat_organization}"
|
|
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
+
from metrics_evaluation.schema.cvat import CvatApiLabelDefinition, CvatApiProjectDetails
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
|
|
| 98 |
Returns:
|
| 99 |
List of job IDs
|
| 100 |
"""
|
| 101 |
+
from metrics_evaluation.schema.cvat import CvatApiJobsListResponse
|
| 102 |
|
| 103 |
headers = self.client._get_headers(token)
|
| 104 |
url = f"{self.client.cvat_host}/api/jobs?project_id={project_id}&page_size=1000&org={self.client.cvat_organization}"
|
metrics_evaluation/cvat_api/tasks.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
-
from
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
@@ -91,7 +91,7 @@ class TasksMethods:
|
|
| 91 |
Returns:
|
| 92 |
List of job IDs
|
| 93 |
"""
|
| 94 |
-
from
|
| 95 |
|
| 96 |
headers = self.client._get_headers(token)
|
| 97 |
url = f"{self.client.cvat_host}/api/jobs?task_id={task_id}&page_size=1000"
|
|
|
|
| 2 |
|
| 3 |
from typing import TYPE_CHECKING
|
| 4 |
|
| 5 |
+
from metrics_evaluation.schema.cvat import CvatApiTaskDetails, CvatApiTaskMediasMetainformation
|
| 6 |
|
| 7 |
from .retry import retry_with_backoff
|
| 8 |
|
|
|
|
| 91 |
Returns:
|
| 92 |
List of job IDs
|
| 93 |
"""
|
| 94 |
+
from metrics_evaluation.schema.cvat import CvatApiJobsListResponse
|
| 95 |
|
| 96 |
headers = self.client._get_headers(token)
|
| 97 |
url = f"{self.client.cvat_host}/api/jobs?task_id={task_id}&page_size=1000"
|
metrics_evaluation/extraction/cvat_extractor.py
CHANGED
|
@@ -7,7 +7,7 @@ from pathlib import Path
|
|
| 7 |
from typing import Any
|
| 8 |
|
| 9 |
from ..config.config_models import EvaluationConfig
|
| 10 |
-
from ..cvat_api.client import
|
| 11 |
from ..schema.core.annotation.mask import Mask
|
| 12 |
|
| 13 |
logger = logging.getLogger(__name__)
|
|
@@ -26,7 +26,7 @@ class CVATExtractor:
|
|
| 26 |
ValueError: If configuration is invalid
|
| 27 |
"""
|
| 28 |
self.config = config
|
| 29 |
-
self.client:
|
| 30 |
self.project_id: int | None = None
|
| 31 |
|
| 32 |
def connect(self) -> None:
|
|
@@ -51,7 +51,7 @@ class CVATExtractor:
|
|
| 51 |
)
|
| 52 |
|
| 53 |
try:
|
| 54 |
-
self.client =
|
| 55 |
host=self.config.cvat.url,
|
| 56 |
credentials=(username, password),
|
| 57 |
organization=self.config.cvat.organization,
|
|
|
|
| 7 |
from typing import Any
|
| 8 |
|
| 9 |
from ..config.config_models import EvaluationConfig
|
| 10 |
+
from ..cvat_api.client import CvatApiClient
|
| 11 |
from ..schema.core.annotation.mask import Mask
|
| 12 |
|
| 13 |
logger = logging.getLogger(__name__)
|
|
|
|
| 26 |
ValueError: If configuration is invalid
|
| 27 |
"""
|
| 28 |
self.config = config
|
| 29 |
+
self.client: CvatApiClient | None = None
|
| 30 |
self.project_id: int | None = None
|
| 31 |
|
| 32 |
def connect(self) -> None:
|
|
|
|
| 51 |
)
|
| 52 |
|
| 53 |
try:
|
| 54 |
+
self.client = CvatApiClient(
|
| 55 |
host=self.config.cvat.url,
|
| 56 |
credentials=(username, password),
|
| 57 |
organization=self.config.cvat.organization,
|
metrics_evaluation/run_evaluation.py
CHANGED
|
@@ -7,12 +7,12 @@ import logging
|
|
| 7 |
import sys
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
-
from config.config_loader import load_config
|
| 11 |
-
from extraction.cvat_extractor import CVATExtractor
|
| 12 |
-
from inference.sam3_inference import SAM3Inferencer
|
| 13 |
-
from metrics.metrics_calculator import MetricsCalculator
|
| 14 |
-
from utils.logging_config import setup_logging
|
| 15 |
-
from visualization.visual_comparison import VisualComparator
|
| 16 |
|
| 17 |
logger = logging.getLogger(__name__)
|
| 18 |
|
|
|
|
| 7 |
import sys
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
+
from metrics_evaluation.config.config_loader import load_config
|
| 11 |
+
from metrics_evaluation.extraction.cvat_extractor import CVATExtractor
|
| 12 |
+
from metrics_evaluation.inference.sam3_inference import SAM3Inferencer
|
| 13 |
+
from metrics_evaluation.metrics.metrics_calculator import MetricsCalculator
|
| 14 |
+
from metrics_evaluation.utils.logging_config import setup_logging
|
| 15 |
+
from metrics_evaluation.visualization.visual_comparison import VisualComparator
|
| 16 |
|
| 17 |
logger = logging.getLogger(__name__)
|
| 18 |
|