Skip to content

Commit 221166f

Browse files
omidvarniaqubvel
andauthored
Add binary segmentation example using cpu (#1057)
* Add binary segmentation example using cpu * Update of the binary segmentation example * Update on the binary segmentation example script. * Update on the binary segmentation example script. * Pass all tests by the added binary segmentation exameple * Update examples/binary_segmentation_buildings.py --------- Co-authored-by: Pavel Iakubovskii <[email protected]>
1 parent aa7f35a commit 221166f

File tree

2 files changed

+521
-10
lines changed

2 files changed

+521
-10
lines changed

Makefile

+23-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
.PHONY: test
1+
.PHONY: test # Declare the 'test' target as phony to avoid conflicts with files named 'test'
22

3+
# Variables to store the paths of the python, pip, pytest, and ruff executables
4+
PYTHON := $(shell which python)
5+
PIP := $(shell which pip)
6+
PYTEST := $(shell which pytest)
7+
RUFF := $(shell which ruff)
8+
9+
# Target to create a Python virtual environment
310
.venv:
4-
python3 -m venv .venv
11+
$(PYTHON) -m venv $(shell dirname $(PYTHON))
512

13+
# Target to install development dependencies in the virtual environment
614
install_dev: .venv
7-
.venv/bin/pip install -e ".[test]"
15+
$(PIP) install -e ".[test]"
816

17+
# Target to run tests with pytest, using 2 parallel processes and only non-marked tests
918
test: .venv
10-
.venv/bin/pytest -v -rsx -n 2 tests/ --non-marked-only
19+
$(PYTEST) -v -rsx -n 2 tests/ --non-marked-only
1120

21+
# Target to run all tests with pytest, including slow tests, using 2 parallel processes
1222
test_all: .venv
13-
RUN_SLOW=1 .venv/bin/pytest -v -rsx -n 2 tests/
23+
RUN_SLOW=1 $(PYTEST) -v -rsx -n 2 tests/
1424

25+
# Target to generate a table by running a Python script
1526
table:
16-
.venv/bin/python misc/generate_table.py
27+
$(PYTHON) misc/generate_table.py
1728

29+
# Target to generate a table for timm by running a Python script
1830
table_timm:
19-
.venv/bin/python misc/generate_table_timm.py
31+
$(PYTHON) misc/generate_table_timm.py
2032

33+
# Target to fix and format code using ruff
2134
fixup:
22-
.venv/bin/ruff check --fix
23-
.venv/bin/ruff format
35+
$(RUFF) check --fix
36+
$(RUFF) format
2437

38+
# Target to run code formatting and tests
2539
all: fixup test
26-

0 commit comments

Comments
 (0)