-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from FocoosAI/feat/test-coverage
test coverage
- Loading branch information
Showing
28 changed files
with
2,143 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"python.analysis.typeCheckingMode": "basic", | ||
"python.analysis.autoImportCompletions": true | ||
"python.analysis.autoImportCompletions": true, | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
.PHONY: test install install-dev install-pre-commit run-pre-commit | ||
.PHONY: test install install-dev install-pre-commit run-pre-commit .uv .pre-commit tox | ||
|
||
install: | ||
@pip install . --no-cache-dir | ||
install-dev: | ||
@pip install -e ".[dev]" --no-cache-dir | ||
.uv: ## Check that uv is installed | ||
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/' | ||
|
||
install-pre-commit: | ||
.pre-commit: ## Check that pre-commit is installed | ||
@pre-commit -V || echo 'Please install pre-commit: https://pre-commit.com/' | ||
|
||
install: .uv .pre-commit | ||
@uv venv | ||
@uv pip install -e ".[cpu,dev]" | ||
@pre-commit install | ||
|
||
install-gpu: .uv .pre-commit | ||
@uv venv | ||
@uv pip install -e ".[dev,gpu]" | ||
@pre-commit install | ||
|
||
lint: | ||
@isort ./focoos --profile=black | ||
@black ./focoos | ||
run-pre-commit: | ||
@isort ./focoos ./tests --profile=black | ||
@black ./focoos ./tests | ||
|
||
run-pre-commit: .pre-commit | ||
@pre-commit run --all-files | ||
|
||
test: | ||
@pytest -s --cov=focoos --cov-report="xml:tests/coverage.xml" --junitxml=./tests/junit.xml && rm -f .coverage | ||
@pytest -s --cov=focoos --cov-report="xml:tests/coverage.xml" --cov-report=html --junitxml=./tests/junit.xml && rm -f .coverage | ||
|
||
tox: | ||
tox | ||
|
||
clean: | ||
@rm -rf build dist *.egg-info .tox .nox .coverage .coverage.* .cache .pytest_cache htmlcov | ||
@rm -rf build dist *.egg-info .tox .nox .coverage .coverage.* .cache .pytest_cache htmlcov */coverage.xml */junit.xml .venv | ||
@find . -type d -name "__pycache__" -exec rm -r {} + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,78 @@ | ||
from .config import FOCOOS_CONFIG | ||
from .focoos import Focoos | ||
from .local_model import LocalModel | ||
from .ports import * | ||
from .ports import ( | ||
DEV_API_URL, | ||
LOCAL_API_URL, | ||
PROD_API_URL, | ||
DatasetInfo, | ||
DatasetLayout, | ||
DatasetMetadata, | ||
DeploymentMode, | ||
FocoosDet, | ||
FocoosDetections, | ||
FocoosTask, | ||
GPUInfo, | ||
Hyperparameters, | ||
LatencyMetrics, | ||
ModelMetadata, | ||
ModelPreview, | ||
ModelStatus, | ||
OnnxEngineOpts, | ||
RuntimeTypes, | ||
SystemInfo, | ||
TraininingInfo, | ||
TrainInstance, | ||
) | ||
from .remote_model import RemoteModel | ||
from .runtime import ONNXRuntime, get_runtime | ||
from .utils.system import get_system_info | ||
from .utils.vision import ( | ||
base64mask_to_mask, | ||
binary_mask_to_base64, | ||
class_to_index, | ||
focoos_detections_to_supervision, | ||
image_loader, | ||
image_preprocess, | ||
index_to_class, | ||
sv_to_focoos_detections, | ||
) | ||
|
||
__all__ = [ | ||
"FOCOOS_CONFIG", | ||
"Focoos", | ||
"LocalModel", | ||
"RemoteModel", | ||
"FocoosDetections", | ||
"FocoosDet", | ||
"FocoosTask", | ||
"ModelMetadata", | ||
"ModelStatus", | ||
"DatasetInfo", | ||
"DatasetLayout", | ||
"DatasetMetadata", | ||
"DeploymentMode", | ||
"GPUInfo", | ||
"Hyperparameters", | ||
"LatencyMetrics", | ||
"ModelPreview", | ||
"OnnxEngineOpts", | ||
"RuntimeTypes", | ||
"SystemInfo", | ||
"TraininingInfo", | ||
"TrainInstance", | ||
"get_system_info", | ||
"ONNXRuntime", | ||
"get_runtime", | ||
"DEV_API_URL", | ||
"LOCAL_API_URL", | ||
"PROD_API_URL", | ||
"base64mask_to_mask", | ||
"binary_mask_to_base64", | ||
"class_to_index", | ||
"focoos_detections_to_supervision", | ||
"image_loader", | ||
"image_preprocess", | ||
"index_to_class", | ||
"sv_to_focoos_detections", | ||
] |
Oops, something went wrong.