Spaces:
Sleeping
Sleeping
Download tests/test_params.py from DmitryPlant/plants-analysis-api: direct link, hf CLI and curl.
- Browser
- Download file 512 Bytes
-
https://huggingface.co/spaces/DmitryPlant/plants-analysis-api/resolve/main/tests/test_params.py
- Command line
-
hf download hf://spaces/DmitryPlant/plants-analysis-api/tests/test_params.py
-
curl -L -o test_params.py https://huggingface.co/spaces/DmitryPlant/plants-analysis-api/resolve/main/tests/test_params.py
512 Bytes
| from analysis.params import AnalysisParams, DEFAULT_PARAMS | |
| def test_default_params_match_notebook(): | |
| p = DEFAULT_PARAMS | |
| assert p.v_threshold == 150 | |
| assert p.min_area == 100 | |
| assert p.h == 5 | |
| assert p.large_kernel == 7 | |
| def test_params_round_trip_through_dict(): | |
| p = AnalysisParams(v_threshold=200, min_area=50) | |
| assert AnalysisParams(**p.to_dict()) == p | |
| def test_params_clamp_kernel_to_odd(): | |
| p = AnalysisParams(large_kernel=8) | |
| assert p.large_kernel == 9 | |