DeepForest icon indicating copy to clipboard operation
DeepForest copied to clipboard

Issue 516 boxes to shapefile should take in absolute path to rgb

Open 2ArounD opened this issue 2 years ago • 6 comments

Hi!

The DeepForest project sounds awesome, so I'm looking to contribute. To get started I picked up one of the issues and fixed it. Let me know what you think. I hope to learn more about this project while contributing!

All the best, Arnoud

2ArounD avatar Nov 19 '23 23:11 2ArounD

Awesome. We love new contributors. What's your background and interest? You picked an interesting issue. My first reaction was, was that really labeled good first issue? I think there are some downstream effects that need to be thought about here that I will review tomorrow. I think there are several functions that assume relative paths. This is definitely needed and important, since its quite strange that DeepForest API insists the file structure has a certain setup, its clearly a design flaw related to the history of the project. Something we want to improve. I'll take a detailed look tomorrow.

bw4sz avatar Nov 19 '23 23:11 bw4sz

My background in a nutshell: Education: MsC in mechanical engineering, with lot's of focus on software, computer vision and AI for self driving Work experience: Data scientist/software engineer. Previously: 2 years in a company focused on document automation (lot's of optical character recognition and text classification). Current: 1 year in a company focused on Bird monitoring with video cameras (lot's of computer vision, image based machine learning and temporal data machine learning) I am based in Oslo

Interests: Going to the mountains and the forest, picking mushrooms, picking berries, cross country skiing, ice skating, kayaking, cycling, rugby, cooking, AI, ecology, sustainable energy

When I woke up this morning I realised I didn't look through the repository for usage of the function, only triggered the tests, good idea to check that. Just ping me on what needs to happen.

2ArounD avatar Nov 20 '23 11:11 2ArounD

Great, its thanksgiving break here, so a short delay in reviewing this.

bw4sz avatar Nov 22 '23 04:11 bw4sz

No problem! Review it when you have time

2ArounD avatar Nov 22 '23 08:11 2ArounD

Great. I'm now remember why this had a good_first_issue tag. We are leaving the wider question of absolute path versus relative path, which underlies a half dozen training functions, like https://deepforest.readthedocs.io/en/latest/training.html and just concerns itself with this one function. Let's do two things. We don't like breaking changes if we don't need them. We want to adopt a strategy of warn users and then set a deprecation time.

  1. Keep the root_dir argument.
  2. If root_dir is specified, raise DeprecationWarning and tell user that relative path will be deprecated in DeepForest 2.0 and please specify absolute path.
  3. Then have an if statement.

https://github.com/weecology/DeepForest/blob/af1c4d4a76064c1834f0cbdf2986a978204593e4/deepforest/utilities.py#L398

if root_dir:
   rgb_path = "{}/{}".format(root_dir, plot_name)
  1. Minor detail, elsewhere we use image_path, not rgb_image_path, shorter naming of the arg and matching with other functions.

Thanks for your PR, we appreciate all the help as we grow the community.

bw4sz avatar Nov 30 '23 17:11 bw4sz

Thanks for the response, I didn't forget about this, I just haven't had the time yet to have a look. I'm coming back to it later this week

2ArounD avatar Dec 05 '23 10:12 2ArounD

Closing due to inactivity. Feel free to reopen if anyone comes back to this.

ethanwhite avatar Aug 04 '24 16:08 ethanwhite