-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflow.py
35 lines (26 loc) · 904 Bytes
/
workflow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# Example workflows for both models
#
import os
import birdspy as bs
# MESA Distance
# Save MATLAB ground-truth image files
# bs.ImageFactory.ground_truth_factory("mesa_distance/data/")
# Ridge Regression
# Generate training and testing datasets
for sub_folder in [
"HVITa2016a_renamed",
"HVITa2016b_renamed",
"HVITa2016c_renamed",
"HVITa2016d_renamed",
]:
bs.DatasetFactory.generate_datasets(
train_path=os.path.join("ridge_regression", "bird_data", "train"),
test_path=os.path.join("ridge_regression", "bird_data", "test"),
image_path=os.path.join("images", "HVITa_renamed", sub_folder),
test_frac=8,
)
# Print output files as .csv
# This currently only returns count per image, but could threshold object density
# to return bird locations in the future
# bs.OutputWriter.write_csv("ridge_regression/bird_data/output", "output.csv")