You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.7 KiB
76 lines
1.7 KiB
# Makefile for One-Prompt Medical Image Segmentation
|
|
# Common commands for development, testing, and training
|
|
|
|
.PHONY: help install install-dev test lint format clean train eval docs
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo " install Install production dependencies"
|
|
@echo " install-dev Install development dependencies"
|
|
@echo " test Run unit tests"
|
|
@echo " lint Run code linting"
|
|
@echo " format Format code with black and isort"
|
|
@echo " clean Clean temporary files"
|
|
@echo " train Run training script"
|
|
@echo " eval Run evaluation script"
|
|
@echo " docs Build documentation"
|
|
|
|
# Installation
|
|
install:
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
|
|
install-dev:
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
pip install -e .
|
|
pre-commit install
|
|
|
|
# Testing
|
|
test:
|
|
pytest tests/ -v --cov=src/oneprompt_seg --cov-report=html
|
|
|
|
test-quick:
|
|
pytest tests/ -v -x
|
|
|
|
# Linting and formatting
|
|
lint:
|
|
flake8 src/ tests/
|
|
mypy src/
|
|
|
|
format:
|
|
black src/ tests/ scripts/
|
|
isort src/ tests/ scripts/
|
|
|
|
# Cleaning
|
|
clean:
|
|
find . -type f -name "*.pyc" -delete
|
|
find . -type d -name "__pycache__" -delete
|
|
find . -type d -name ".pytest_cache" -delete
|
|
find . -type d -name ".mypy_cache" -delete
|
|
rm -rf build/ dist/ *.egg-info/
|
|
rm -rf .coverage htmlcov/
|
|
|
|
# Training and evaluation
|
|
train:
|
|
python scripts/train.py --config configs/default.yaml
|
|
|
|
train-polyp:
|
|
python scripts/train.py \
|
|
-net oneprompt \
|
|
-mod one_adpt \
|
|
-exp_name polyp_training \
|
|
-dataset polyp \
|
|
-data_path ./data/polyp
|
|
|
|
eval:
|
|
python scripts/val.py --config configs/default.yaml
|
|
|
|
# Documentation
|
|
docs:
|
|
cd docs && make html
|
|
|
|
docs-clean:
|
|
cd docs && make clean
|