DeepForest: Training model with annos throws Xmin, Ymin,... error

Hi,

I’m running DeepForest in Google CoLab, and ran into an issue with the annotation file, I think.

To answer your User Story question, I’m a forest ecologist at Washington State University. I’m helping the City of Anacortes, WA to build a tree species map for ~3,000 acres of community owned forest land. The map will serve as the basis for a baseline assessment of forest health and a broader community led monitoring program.

Here’s my issue.

I’m trying to train the model. Attached are my annotations. Annotations were polygons. I converted them to annos using your tools. WL_train_annotation.csv. I I can supply the image if needed, but I couldn’t attach.

Here’s my code to train the model

#initialize the model and change the corresponding config file
m = main.deepforest()
m.use_release()

#load the lastest release model
m.config["train"]["csv_file"] = '/content/drive/MyDrive/ACFL_Colab/Data/Imagery/model_training/WL_train_annotation.csv'
m.config["train"]["root_dir"] = '/content/drive/MyDrive/ACFL_Colab/Data/Imagery/model_training/'
m.config["score_thresh"] = 0.4
m.config["train"]['epochs'] = 2 #increase to 20 when no bugs
m.config["train"]["lr"] = 0.00001 #learning rates:currently low but vary this
m.config["train"]["fast_dev_run"] = True #for debugging

# Initialize the trainer
m.trainer.fit(m) #this line is throwing the error

Here is the error that I’m getting

KeyError: “None of [Index([‘xmin’, ‘ymin’, ‘xmax’, ‘ymax’], dtype=‘object’)] are in the [columns]”

I think this means that I need to have columns in my annotations file for xmin, ymin, etc… Do you agree or is there some other issue?

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for reporting this @robAndrus34 and thanks to @rhydham-nith a temporary solution for Rob to work with! We do actually have a function (that is deprecated as part of the work mentioned below but is still present) that will do this conversion: shapefile_to_annotations.

We’ve been working on supporting different kinds of annotations so that we can work with points and polygons as well as bounding boxes. So, yes, in the case of bounding box based models (like the main retinanet model) we should support the automatic handling of the square polygon data read in by read_file(). @bw4sz has been doing this work and should be back around tomorrow and can let us know if this functionality still needs to be added or if it just isn’t working quite right.