-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
208 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from deepforest import model | ||
import pandas as pd | ||
import os | ||
import comet_ml | ||
from pytorch_lightning.loggers import CometLogger | ||
from src.classification import preprocess_and_train_classification | ||
import hydra | ||
from omegaconf import DictConfig | ||
|
||
@hydra.main(config_path="conf/classification_model", config_name="USGS") | ||
def main(cfg: DictConfig): | ||
classification_cfg = cfg.classification | ||
savedir = classification_cfg.savedir | ||
train = pd.read_csv(os.path.join(savedir, "train.csv")) | ||
test = pd.read_csv(os.path.join(savedir, "test.csv")) | ||
|
||
comet_logger = CometLogger(project_name=classification_cfg.project_name, workspace=classification_cfg.workspace) | ||
preprocess_and_train_classification( | ||
config=cfg, | ||
train_df=train, | ||
validation_df=test, | ||
comet_logger=comet_logger | ||
) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
classification_model: | ||
checkpoint: | ||
checkpoint_dir: /blue/ewhite/b.weinstein/BOEM/UBFAI Images with Detection Data/classification/checkpoints/ | ||
train_csv_folder: | ||
train_image_dir: /blue/ewhite/b.weinstein/BOEM/sample_flight/JPG_2024_Jan27/annotated | ||
crop_image_dir: /blue/ewhite/b.weinstein/BOEM/UBFAI Images with Detection Data/classification/ | ||
under_sample_ratio: 0 | ||
trainer: | ||
fast_dev_run: True | ||
max_epochs: 1 | ||
lr: 0.00001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
classification_model: | ||
checkpoint: | ||
checkpoint_dir: /blue/ewhite/b.weinstein/BOEM/classification/checkpoints | ||
train_csv_folder: /blue/ewhite/b.weinstein/BOEM/annotations/train | ||
train_image_dir: /blue/ewhite/b.weinstein/BOEM/sample_flight/JPG_2024_Jan27/annotated | ||
crop_image_dir: /blue/ewhite/b.weinstein/BOEM/classification/crops/ | ||
under_sample_ratio: 0 | ||
trainer: | ||
fast_dev_run: True | ||
max_epochs: 1 | ||
lr: 0.00001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.