uv sync
uv run python -m autotomeqcUse this mode to quickly test your saved section images. It launches the service and waits for you to paste file paths for analysis.
Run the service:
uv run python -m autotomeqcOnce the service says Ready >, you can:
Paste a file path: example/input_images/img0.jpg
Exit: Type exit, stop, or press Ctrl+C.
You can import AutoTomeService directly into your own Python code to integrate QC into your acquisition loops.
See the example codes example/example_import.py
from autotomeqc.core.autotome_service import AutoTomeService
# Initialize Service (Loads YOLO & Classification Models)
service = AutoTomeService()
service.start()
# Method A: Process by File Path
future_a = service.process(img_path="data/sample_01.jpg")
result = future_a.result() # Wait for the result
print(f"QC Status: {result['qc_summary']}")
# Method B: Process by Raw Frame (e.g., from Camera)
future_b = service.process(frame=frame)
result = future_a.result() # Wait for the result
print(f"QC Status: {result['qc_summary']}")
service.stop()A full JSON report are also saved to disk.
Directory: The location is defined in src/autotomeqc/config/yolo-config.yaml (see the output_dir setting).
Files: {filename}_qc.json
And, you can view the results directly in the terminal:
Example Output:
Ready > example/input_images/img0.jpg
Processing... Done.
✅ PASS: PASS
Details:
{
"shape": { "label": "Hexagon", "pass": true },
"coverage": { "label": "full_section", "conf": 0.99, "pass": true },
"knife_mark": { "label": "knifemark_none", "pass": true },
...
}This project utilizes uv to handle installing dependencies as well as setting up environments for this project. It replaces tool like pip, poetry, virtualenv, and conda.
This project also uses tox for orchestrating multiple testing environments that mimics the github actions CI/CD so that you can test the workflows locally on your machine before pushing changes.
The following are tools used to ensure code quality in this project.
- Unit Testing
uv run pytest tests- Linting
uv run ruff check- Type Check
uv run mypy srcTo generate the rst files source files for documentation, run
sphinx-apidoc -o docs/source/ srcThen to create the documentation HTML files, run
sphinx-build -b html docs/source/ docs/build/html