From a17411e9684fa86f512d52955e218473bef42bcf Mon Sep 17 00:00:00 2001 From: Ethan White Date: Sun, 15 Sep 2024 22:36:22 -0400 Subject: [PATCH] Cleanup docs on reading shape files to avoid user confusion (#783) * Have docs on reading shape files show a standard path The docs showed reading a file from a tmpdir using the previous generation of format strings. This is confusing to users (see #781). Fixes #781 * Remove local shell command; just show csv contents OS specific shell commands with local path information can be confusing to users. This removes that command the just shows the output (the structure of the csv file) which is all the user needs to understand the behavior of the documented functions. --- docs/getting_started/Reading_and_Writing.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/getting_started/Reading_and_Writing.md b/docs/getting_started/Reading_and_Writing.md index 3827c190..f2aba8e2 100644 --- a/docs/getting_started/Reading_and_Writing.md +++ b/docs/getting_started/Reading_and_Writing.md @@ -13,8 +13,8 @@ DeepForest was originally designed for bounding box annotations. As of DeepFores #### CSV Here the annotations are in plain csv files, with coordinates relative to image origin. + ``` -(DeepForest) (base) benweinstein@Bens-MacBook-Pro data % cat OSBS_029.csv image_path,xmin,ymin,xmax,ymax,label OSBS_029.tif,203,67,227,90,Tree OSBS_029.tif,256,99,288,140,Tree @@ -25,6 +25,7 @@ OSBS_029.tif,365,21,400,70,Tree OSBS_029.tif,278,1,312,37,Tree OSBS_029.tif,364,204,400,246,Tree ``` + ``` filename = get_data("OSBS_029.csv") utilities.read_file(filename) @@ -52,7 +53,7 @@ Name: 0, dtype: object These coordinates are made relative to the image origin when the file is read. ``` -shp = utilities.read_file(input="{}/test_read_file_boxes_projected.shp".format(tmpdir)) +shp = utilities.read_file(input="/path/to/boxes_shapefile.shp") shp.head() label image_path geometry 0 Tree OSBS_029.tif POLYGON ((105.000 214.000, 95.000 214.000, 95.... @@ -71,7 +72,7 @@ x,y,label ### Shapefile ``` -annotations = utilities.read_file(input="{}/test_read_file_points_projected.shp".format(tmpdir)) +shp = utilities.read_file(input="/path/to/points_shapefile.shp") annotations.head() label image_path geometry 0 Tree OSBS_029.tif POINT (100.000 209.000) @@ -90,8 +91,9 @@ Polygons are expressed well-known-text format. Learn more about (wkt)[https://en ``` ## Shapefile + ``` -annotations = utilities.read_file(input="{}/test_read_file_polygons_unprojected.shp".format(tmpdir)) +shp = utilities.read_file(input="/path/to/polygons_shapefile.shp") annotations.head() label image_path geometry 0 Tree OSBS_029.png POLYGON ((0.00000 0.00000, 0.00000 2.00000, 1....