harbor run -t openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0424harbor download openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0424You are asked to implement a self-contained, deterministic deepforest utility in a single Python file placed under the /app/ directory. The solution should expose three namespaces (acting like lightweight submodules) that tests expect to import as:
In this MEDIUM version, implement everything in one file for simplicity, but preserve the same public API surface as the original multi-file package. Your file should reside at /app/deepforest.py and provide three namespaces with the required functions.
What to implement
Namespace: preprocess
Functions to implement:
a) def compute_windows(image: numpy.ndarray, patch_size: int, patch_overlap: float) -> list[dict]
b) def select_annotations(annotations: pandas.DataFrame, windows: list, index: int) -> pandas.DataFrame
c) def split_raster(annotations_file: Union[str, pandas.DataFrame], path_to_raster: str = None, numpy_image: numpy.ndarray = None, image_name: str = None, base_dir: str = ".", patch_size: int = 200, patch_overlap: float = 0.25, allow_empty: bool = True) -> pandas.DataFrame
Notes and practical guidance
Deliverable
A single Python file placed at /app/deepforest.py implementing the three namespaces as described:
The implementation should be robust, deterministic for the included test data, and rely only on standard libraries and common packages (numpy, pandas, PIL). No network access is required.
Hints and example considerations are provided to guide you through the expected behavior, but you are not required to reproduce the entire original project structure.