Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no reason to ask for the height, width on plot_results. #834

Open
bw4sz opened this issue Nov 11, 2024 · 0 comments
Open

There is no reason to ask for the height, width on plot_results. #834

bw4sz opened this issue Nov 11, 2024 · 0 comments

Comments

@bw4sz
Copy link
Collaborator

bw4sz commented Nov 11, 2024

If the data is well formatted.

gdf.head()
   id                                            polygon  ...                  source                                           geometry
0   1  POLYGON ((79 683,78 684,77 684,76 685,75 686,7...  ...  Justdiggit et al. 2023  POLYGON ((79 683, 78 684, 77 684, 76 685, 75 6...
1   2  POLYGON ((275 323,274 324,273 324,272 324,271 ...  ...  Justdiggit et al. 2023  POLYGON ((275 323, 274 324, 273 324, 272 324, ...
2   3  POLYGON ((197 239,196 240,195 240,194 240,194 ...  ...  Justdiggit et al. 2023  POLYGON ((197 239, 196 240, 195 240, 194 240, ...
3   4  POLYGON ((996 465,995 466,994 467,993 466,992 ...  ...  Justdiggit et al. 2023  POLYGON ((996 465, 995 466, 994 467, 993 466, ...
4   5  POLYGON ((934 582,933 583,932 584,931 584,930 ...  ...  Justdiggit et al. 2023  POLYGON ((934 582, 933 583, 932 584, 931 584, ...

[5 rows x 6 columns]
gdf.root_dir
'/orange/ewhite/DeepForest/justdiggit-drone/label_sample/'
    plot_results(gdf)
Traceback (most recent call last):
  File "/blue/ewhite/b.weinstein/miniconda3/envs/MillionTrees/lib/python3.10/site-packages/deepforest/visualize.py", line 433, in plot_results
    annotated_scene = _plot_image_with_results(df=results,
  File "/blue/ewhite/b.weinstein/miniconda3/envs/MillionTrees/lib/python3.10/site-packages/deepforest/visualize.py", line 485, in _plot_image_with_results
    detections = convert_to_sv_format(df, height=height, width=width)
  File "/blue/ewhite/b.weinstein/miniconda3/envs/MillionTrees/lib/python3.10/site-packages/deepforest/visualize.py", line 323, in convert_to_sv_format
    raise ValueError(
ValueError: height and width of the mask must be provided for polygon predictions

to fix, just go and get the height and width within the function, everything is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant