From 4ed6f7680f0172f1fded60c9f83f4c78c1891a6b Mon Sep 17 00:00:00 2001 From: Om Doiphode Date: Sun, 18 Aug 2024 10:17:55 +0530 Subject: [PATCH] Removed deepforest_docs folder Use models from Huggingface Clean up the tests Update style for tests Switch to opencv-python-headless Using opencv-python was causing installation conflicts with albumentations which relies on the headless version. We were only using the GUI aspects of opencv in a single, debugging only, function. So this switches that function to matplotlib and updates the dependencies. Fixes #464. Don't install opencv via apt for testing We want to test the Python installs so we shouldn't be doing an apt install. This is particularly true since we've switched to opencv-python-headless as the dependency. --- .../deepforest_docs => }/CONTRIBUTING.md | 0 docs/Makefile | 2 +- docs/{source => }/_templates/navbar2.html | 0 .../advanced_features/CropModels.md | 0 .../advanced_features/ExtendingModule.md | 0 .../advanced_features/Model_Architecture.md | 0 .../advanced_features/index.rst | 0 .../advanced_features/multi_species.md | 0 .../advanced_features/scaling.md | 0 .../advanced_features/visualizations.md | 0 docs/{source => }/conf.py | 8 +- .../data_annotation/annotation.md | 4 +- .../data_annotation/index.rst | 0 .../deepforest_docs => }/deepforestr.md | 0 docs/developer_resources/authors.rst | 1 + .../developer_resources/code_of_conduct.rst | 0 docs/developer_resources/history.rst | 1 + .../developer_resources/index.rst | 0 .../examples/Australia.ipynb | 0 .../examples/nest_detection.ipynb | 0 .../deepforest_docs => }/figures/Figure_1.png | Bin .../figures/TrainingData.png | Bin .../figures/batch_classification_loss.svg | 0 .../figures/batch_regression_loss.svg | 0 .../figures/iou_equation.png | Bin .../figures/output_17_1.png | Bin .../figures/output_23_1.png | Bin .../figures/output_28_0.png | Bin .../figures/output_32_0.png | Bin .../figures/output_65_0.png | Bin .../figures/output_70_0.png | Bin .../figures/output_71_0.png | Bin .../tree_predicted_bounding_boxes.jpeg | Bin .../figures/tree_predicted_labels.jpeg | Bin .../getting_started/Reading_and_Writing.md | 0 .../getting_started.md | 2 +- .../getting_started/index.rst | 0 .../getting_started/sample.ipynb | 0 docs/index.rst | 9 ++ .../ConfigurationFile.md | 0 .../installation_and_setup/index.rst | 0 .../installation_and_setup/installation.md | 0 .../installation_and_setup/prebuilt.md | 6 +- .../introduction/index.rst | 1 - .../introduction/landing.md | 2 +- docs/{source/deepforest_docs => }/make.bat | 0 .../related_work/index.rst | 0 .../deepforest_docs => }/related_work/use.md | 0 .../deepforest_docs => }/requirements.txt | 0 .../source => }/deepforest.data.rst | 0 .../source => }/deepforest.rst | 0 .../developer_resources/authors.rst | 1 - .../developer_resources/history.rst | 1 - .../getting_started/getting_started.md | 83 ------------------ docs/source/deepforest_docs/index.rst | 61 ------------- docs/source/index.rst | 60 ++++++++++++- .../{deepforest_docs/source => }/modules.rst | 0 .../training_and_evaluation/Evaluation.md | 0 .../training_and_evaluation/better.md | 4 +- .../training_and_evaluation/index.rst | 0 .../training_and_evaluation/training.md | 0 setup.py | 12 +-- 62 files changed, 88 insertions(+), 170 deletions(-) rename docs/{source/deepforest_docs => }/CONTRIBUTING.md (100%) rename docs/{source => }/_templates/navbar2.html (100%) rename docs/{source/deepforest_docs => }/advanced_features/CropModels.md (100%) rename docs/{source/deepforest_docs => }/advanced_features/ExtendingModule.md (100%) rename docs/{source/deepforest_docs => }/advanced_features/Model_Architecture.md (100%) rename docs/{source/deepforest_docs => }/advanced_features/index.rst (100%) rename docs/{source/deepforest_docs => }/advanced_features/multi_species.md (100%) rename docs/{source/deepforest_docs => }/advanced_features/scaling.md (100%) rename docs/{source/deepforest_docs => }/advanced_features/visualizations.md (100%) rename docs/{source => }/conf.py (96%) rename docs/{source/deepforest_docs => }/data_annotation/annotation.md (99%) rename docs/{source/deepforest_docs => }/data_annotation/index.rst (100%) rename docs/{source/deepforest_docs => }/deepforestr.md (100%) create mode 100644 docs/developer_resources/authors.rst rename docs/{source/deepforest_docs => }/developer_resources/code_of_conduct.rst (100%) create mode 100644 docs/developer_resources/history.rst rename docs/{source/deepforest_docs => }/developer_resources/index.rst (100%) rename docs/{source/deepforest_docs => }/examples/Australia.ipynb (100%) rename docs/{source/deepforest_docs => }/examples/nest_detection.ipynb (100%) rename docs/{source/deepforest_docs => }/figures/Figure_1.png (100%) rename docs/{source/deepforest_docs => }/figures/TrainingData.png (100%) rename docs/{source/deepforest_docs => }/figures/batch_classification_loss.svg (100%) rename docs/{source/deepforest_docs => }/figures/batch_regression_loss.svg (100%) rename docs/{source/deepforest_docs => }/figures/iou_equation.png (100%) rename docs/{source/deepforest_docs => }/figures/output_17_1.png (100%) rename docs/{source/deepforest_docs => }/figures/output_23_1.png (100%) rename docs/{source/deepforest_docs => }/figures/output_28_0.png (100%) rename docs/{source/deepforest_docs => }/figures/output_32_0.png (100%) rename docs/{source/deepforest_docs => }/figures/output_65_0.png (100%) rename docs/{source/deepforest_docs => }/figures/output_70_0.png (100%) rename docs/{source/deepforest_docs => }/figures/output_71_0.png (100%) rename docs/{source/deepforest_docs => }/figures/tree_predicted_bounding_boxes.jpeg (100%) rename docs/{source/deepforest_docs => }/figures/tree_predicted_labels.jpeg (100%) rename docs/{source/deepforest_docs => }/getting_started/Reading_and_Writing.md (100%) rename docs/{source/deepforest_docs/introduction => getting_started}/getting_started.md (98%) rename docs/{source/deepforest_docs => }/getting_started/index.rst (100%) rename docs/{source/deepforest_docs => }/getting_started/sample.ipynb (100%) create mode 100644 docs/index.rst rename docs/{source/deepforest_docs => }/installation_and_setup/ConfigurationFile.md (100%) rename docs/{source/deepforest_docs => }/installation_and_setup/index.rst (100%) rename docs/{source/deepforest_docs => }/installation_and_setup/installation.md (100%) rename docs/{source/deepforest_docs => }/installation_and_setup/prebuilt.md (97%) rename docs/{source/deepforest_docs => }/introduction/index.rst (87%) rename docs/{source/deepforest_docs => }/introduction/landing.md (99%) rename docs/{source/deepforest_docs => }/make.bat (100%) rename docs/{source/deepforest_docs => }/related_work/index.rst (100%) rename docs/{source/deepforest_docs => }/related_work/use.md (100%) rename docs/{source/deepforest_docs => }/requirements.txt (100%) rename docs/source/{deepforest_docs/source => }/deepforest.data.rst (100%) rename docs/source/{deepforest_docs/source => }/deepforest.rst (100%) delete mode 100644 docs/source/deepforest_docs/developer_resources/authors.rst delete mode 100644 docs/source/deepforest_docs/developer_resources/history.rst delete mode 100644 docs/source/deepforest_docs/getting_started/getting_started.md delete mode 100644 docs/source/deepforest_docs/index.rst rename docs/source/{deepforest_docs/source => }/modules.rst (100%) rename docs/{source/deepforest_docs => }/training_and_evaluation/Evaluation.md (100%) rename docs/{source/deepforest_docs => }/training_and_evaluation/better.md (97%) rename docs/{source/deepforest_docs => }/training_and_evaluation/index.rst (100%) rename docs/{source/deepforest_docs => }/training_and_evaluation/training.md (100%) diff --git a/docs/source/deepforest_docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 100% rename from docs/source/deepforest_docs/CONTRIBUTING.md rename to docs/CONTRIBUTING.md diff --git a/docs/Makefile b/docs/Makefile index 5bbd3e43e..1821294f6 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,7 +5,7 @@ SPHINXOPTS = SPHINXBUILD = python -msphinx SPHINXPROJ = deepforest -SOURCEDIR = source +SOURCEDIR = . BUILDDIR = _build # Put it first so that "make" without argument is like "make help". diff --git a/docs/source/_templates/navbar2.html b/docs/_templates/navbar2.html similarity index 100% rename from docs/source/_templates/navbar2.html rename to docs/_templates/navbar2.html diff --git a/docs/source/deepforest_docs/advanced_features/CropModels.md b/docs/advanced_features/CropModels.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/CropModels.md rename to docs/advanced_features/CropModels.md diff --git a/docs/source/deepforest_docs/advanced_features/ExtendingModule.md b/docs/advanced_features/ExtendingModule.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/ExtendingModule.md rename to docs/advanced_features/ExtendingModule.md diff --git a/docs/source/deepforest_docs/advanced_features/Model_Architecture.md b/docs/advanced_features/Model_Architecture.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/Model_Architecture.md rename to docs/advanced_features/Model_Architecture.md diff --git a/docs/source/deepforest_docs/advanced_features/index.rst b/docs/advanced_features/index.rst similarity index 100% rename from docs/source/deepforest_docs/advanced_features/index.rst rename to docs/advanced_features/index.rst diff --git a/docs/source/deepforest_docs/advanced_features/multi_species.md b/docs/advanced_features/multi_species.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/multi_species.md rename to docs/advanced_features/multi_species.md diff --git a/docs/source/deepforest_docs/advanced_features/scaling.md b/docs/advanced_features/scaling.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/scaling.md rename to docs/advanced_features/scaling.md diff --git a/docs/source/deepforest_docs/advanced_features/visualizations.md b/docs/advanced_features/visualizations.md similarity index 100% rename from docs/source/deepforest_docs/advanced_features/visualizations.md rename to docs/advanced_features/visualizations.md diff --git a/docs/source/conf.py b/docs/conf.py similarity index 96% rename from docs/source/conf.py rename to docs/conf.py index 44ff215dd..22194ebb7 100644 --- a/docs/source/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ using [reticulate](https://rstudio.github.io/reticulate/) works. """ -file_obj = open('deepforest_docs/deepforestr.md', 'w') +file_obj = open('deepforestr.md', 'w') readme_url = 'https://raw.githubusercontent.com/weecology/deepforestr/main/README.md' file_obj.write(deepforestr_title) @@ -42,7 +42,7 @@ # Create copy of CONTRIBUTING.md contributing_url = "https://raw.githubusercontent.com/weecology/DeepForest/main/CONTRIBUTING.md" -contributing_source = "../../CONTRIBUTING.md" +contributing_source = "../CONTRIBUTING.md" if not os.path.exists(contributing_source): with urllib.request.urlopen(contributing_url) as response: @@ -52,7 +52,7 @@ # reading from file1 and writing to file2 with open(contributing_source, "r") as file1: - with open("deepforest_docs/CONTRIBUTING.md", "w") as file2: + with open("CONTRIBUTING.md", "w") as file2: file2.write(file1.read()) needs_sphinx = "1.8" @@ -78,7 +78,7 @@ templates_path = ['_templates'] # The master toctree document. -master_doc = 'deepforest_docs/index' +master_doc = 'index' # General information about the project. project = u'DeepForest' diff --git a/docs/source/deepforest_docs/data_annotation/annotation.md b/docs/data_annotation/annotation.md similarity index 99% rename from docs/source/deepforest_docs/data_annotation/annotation.md rename to docs/data_annotation/annotation.md index c8a9fd98d..ce6365d4c 100644 --- a/docs/source/deepforest_docs/data_annotation/annotation.md +++ b/docs/data_annotation/annotation.md @@ -4,12 +4,12 @@ Annotation is the most important part of machine learning projects. If you aren ## How should I annotate images? For quick annotations of a few images, we recommend using QGIS or ArcGIS. Either as project or unprojected data. Create a shapefile for each image. -![QGISannotation](../../../../www/QGIS_annotation.png) +![QGISannotation](../../www/QGIS_annotation.png) ### Label-studio For longer term projects, we recommend [label-studio](https://labelstud.io/) as an annotation platform. It has many useful features and is easy to set up. -![QGISannotation](../../../../www/label_studio.png) +![QGISannotation](../../www/label_studio.png) ## Do I need annotate all objects in my image? Yes! Object detection models use the non-annotated areas of an image as negative data. We know that it can be difficult to annotate all objects in an image, but non-annotation will cause the model *to ignore* objects that should be treated as positive samples, leading to poor model performance. diff --git a/docs/source/deepforest_docs/data_annotation/index.rst b/docs/data_annotation/index.rst similarity index 100% rename from docs/source/deepforest_docs/data_annotation/index.rst rename to docs/data_annotation/index.rst diff --git a/docs/source/deepforest_docs/deepforestr.md b/docs/deepforestr.md similarity index 100% rename from docs/source/deepforest_docs/deepforestr.md rename to docs/deepforestr.md diff --git a/docs/developer_resources/authors.rst b/docs/developer_resources/authors.rst new file mode 100644 index 000000000..7739272f9 --- /dev/null +++ b/docs/developer_resources/authors.rst @@ -0,0 +1 @@ +.. include:: ../../AUTHORS.rst diff --git a/docs/source/deepforest_docs/developer_resources/code_of_conduct.rst b/docs/developer_resources/code_of_conduct.rst similarity index 100% rename from docs/source/deepforest_docs/developer_resources/code_of_conduct.rst rename to docs/developer_resources/code_of_conduct.rst diff --git a/docs/developer_resources/history.rst b/docs/developer_resources/history.rst new file mode 100644 index 000000000..5f2e348f2 --- /dev/null +++ b/docs/developer_resources/history.rst @@ -0,0 +1 @@ +.. include:: ../../HISTORY.rst diff --git a/docs/source/deepforest_docs/developer_resources/index.rst b/docs/developer_resources/index.rst similarity index 100% rename from docs/source/deepforest_docs/developer_resources/index.rst rename to docs/developer_resources/index.rst diff --git a/docs/source/deepforest_docs/examples/Australia.ipynb b/docs/examples/Australia.ipynb similarity index 100% rename from docs/source/deepforest_docs/examples/Australia.ipynb rename to docs/examples/Australia.ipynb diff --git a/docs/source/deepforest_docs/examples/nest_detection.ipynb b/docs/examples/nest_detection.ipynb similarity index 100% rename from docs/source/deepforest_docs/examples/nest_detection.ipynb rename to docs/examples/nest_detection.ipynb diff --git a/docs/source/deepforest_docs/figures/Figure_1.png b/docs/figures/Figure_1.png similarity index 100% rename from docs/source/deepforest_docs/figures/Figure_1.png rename to docs/figures/Figure_1.png diff --git a/docs/source/deepforest_docs/figures/TrainingData.png b/docs/figures/TrainingData.png similarity index 100% rename from docs/source/deepforest_docs/figures/TrainingData.png rename to docs/figures/TrainingData.png diff --git a/docs/source/deepforest_docs/figures/batch_classification_loss.svg b/docs/figures/batch_classification_loss.svg similarity index 100% rename from docs/source/deepforest_docs/figures/batch_classification_loss.svg rename to docs/figures/batch_classification_loss.svg diff --git a/docs/source/deepforest_docs/figures/batch_regression_loss.svg b/docs/figures/batch_regression_loss.svg similarity index 100% rename from docs/source/deepforest_docs/figures/batch_regression_loss.svg rename to docs/figures/batch_regression_loss.svg diff --git a/docs/source/deepforest_docs/figures/iou_equation.png b/docs/figures/iou_equation.png similarity index 100% rename from docs/source/deepforest_docs/figures/iou_equation.png rename to docs/figures/iou_equation.png diff --git a/docs/source/deepforest_docs/figures/output_17_1.png b/docs/figures/output_17_1.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_17_1.png rename to docs/figures/output_17_1.png diff --git a/docs/source/deepforest_docs/figures/output_23_1.png b/docs/figures/output_23_1.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_23_1.png rename to docs/figures/output_23_1.png diff --git a/docs/source/deepforest_docs/figures/output_28_0.png b/docs/figures/output_28_0.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_28_0.png rename to docs/figures/output_28_0.png diff --git a/docs/source/deepforest_docs/figures/output_32_0.png b/docs/figures/output_32_0.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_32_0.png rename to docs/figures/output_32_0.png diff --git a/docs/source/deepforest_docs/figures/output_65_0.png b/docs/figures/output_65_0.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_65_0.png rename to docs/figures/output_65_0.png diff --git a/docs/source/deepforest_docs/figures/output_70_0.png b/docs/figures/output_70_0.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_70_0.png rename to docs/figures/output_70_0.png diff --git a/docs/source/deepforest_docs/figures/output_71_0.png b/docs/figures/output_71_0.png similarity index 100% rename from docs/source/deepforest_docs/figures/output_71_0.png rename to docs/figures/output_71_0.png diff --git a/docs/source/deepforest_docs/figures/tree_predicted_bounding_boxes.jpeg b/docs/figures/tree_predicted_bounding_boxes.jpeg similarity index 100% rename from docs/source/deepforest_docs/figures/tree_predicted_bounding_boxes.jpeg rename to docs/figures/tree_predicted_bounding_boxes.jpeg diff --git a/docs/source/deepforest_docs/figures/tree_predicted_labels.jpeg b/docs/figures/tree_predicted_labels.jpeg similarity index 100% rename from docs/source/deepforest_docs/figures/tree_predicted_labels.jpeg rename to docs/figures/tree_predicted_labels.jpeg diff --git a/docs/source/deepforest_docs/getting_started/Reading_and_Writing.md b/docs/getting_started/Reading_and_Writing.md similarity index 100% rename from docs/source/deepforest_docs/getting_started/Reading_and_Writing.md rename to docs/getting_started/Reading_and_Writing.md diff --git a/docs/source/deepforest_docs/introduction/getting_started.md b/docs/getting_started/getting_started.md similarity index 98% rename from docs/source/deepforest_docs/introduction/getting_started.md rename to docs/getting_started/getting_started.md index 34a68bb54..632607078 100644 --- a/docs/source/deepforest_docs/introduction/getting_started.md +++ b/docs/getting_started/getting_started.md @@ -21,7 +21,7 @@ img = model.predict_image(path=sample_image_path, return_plot=True) plt.imshow(img[:,:,::-1]) ``` -![](../../../../www/getting_started1.png) +![](../../www/getting_started1.png) ** please note that this video was made before the deepforest-pytorch -> deepforest name change. ** diff --git a/docs/source/deepforest_docs/getting_started/index.rst b/docs/getting_started/index.rst similarity index 100% rename from docs/source/deepforest_docs/getting_started/index.rst rename to docs/getting_started/index.rst diff --git a/docs/source/deepforest_docs/getting_started/sample.ipynb b/docs/getting_started/sample.ipynb similarity index 100% rename from docs/source/deepforest_docs/getting_started/sample.ipynb rename to docs/getting_started/sample.ipynb diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..d173e86a3 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,9 @@ +:orphan: + +DeepForest +======================== + +.. toctree:: + :maxdepth: 2 + + source/index diff --git a/docs/source/deepforest_docs/installation_and_setup/ConfigurationFile.md b/docs/installation_and_setup/ConfigurationFile.md similarity index 100% rename from docs/source/deepforest_docs/installation_and_setup/ConfigurationFile.md rename to docs/installation_and_setup/ConfigurationFile.md diff --git a/docs/source/deepforest_docs/installation_and_setup/index.rst b/docs/installation_and_setup/index.rst similarity index 100% rename from docs/source/deepforest_docs/installation_and_setup/index.rst rename to docs/installation_and_setup/index.rst diff --git a/docs/source/deepforest_docs/installation_and_setup/installation.md b/docs/installation_and_setup/installation.md similarity index 100% rename from docs/source/deepforest_docs/installation_and_setup/installation.md rename to docs/installation_and_setup/installation.md diff --git a/docs/source/deepforest_docs/installation_and_setup/prebuilt.md b/docs/installation_and_setup/prebuilt.md similarity index 97% rename from docs/source/deepforest_docs/installation_and_setup/prebuilt.md rename to docs/installation_and_setup/prebuilt.md index b83d0ba7a..f5ffd7b93 100644 --- a/docs/source/deepforest_docs/installation_and_setup/prebuilt.md +++ b/docs/installation_and_setup/prebuilt.md @@ -6,7 +6,7 @@ DeepForest has two prebuilt models: Bird Detection and Tree Crown Detection. The model was initially described in [Remote Sensing](https://www.mdpi.com/2072-4292/11/11/1309) on a single site. The prebuilt model uses a semi-supervised approach in which millions of moderate quality annotations are generated using a LiDAR unsupervised tree detection algorithm, followed by hand-annotations of RGB imagery from select sites. Comparisons among geographic sites were added to [Ecological Informatics](https://www.sciencedirect.com/science/article/pii/S157495412030011X). The model was further improved, and the Python package was released in [Methods in Ecology and Evolution](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.13472). -![image](../../../../www/MEE_Figure4.png) +![image](../../www/MEE_Figure4.png) ### Citation > Weinstein, B.G.; Marconi, S.; Bohlman, S.; Zare, A.; White, E. Individual Tree-Crown Detection in RGB Imagery Using Semi-Supervised Deep Learning Neural Networks. Remote Sens. 2019, 11, 1309 @@ -23,7 +23,7 @@ The model was initially described in [Ecological Applications](https://esajourna ### Citation > Weinstein, B.G., Garner, L., Saccomanno, V.R., Steinkraus, A., Ortega, A., Brush, K., Yenni, G., McKellar, A.E., Converse, R., Lippitt, C.D., Wegmann, A., Holmes, N.D., Edney, A.J., Hart, T., Jessopp, M.J., Clarke, R.H., Marchowski, D., Senyondo, H., Dotson, R., White, E.P., Frederick, P. and Ernest, S.K.M. (2022), A general deep learning model for bird detection in high resolution airborne imagery. Ecological Applications. Accepted Author Manuscript e2694. https://doi-org.lp.hscl.ufl.edu/10.1002/eap.2694 -![image](../../../../www/example_predictions_small.png) +![image](../../www/example_predictions_small.png) ``` #Load deepforest model and set bird label @@ -31,7 +31,7 @@ m = main.deepforest(label_dict={"Bird":0}) m.use_bird_release() ``` -![](../../../../www/bird_panel.jpg) +![](../../www/bird_panel.jpg) We have created a [GPU colab tutorial](https://colab.research.google.com/drive/1e9_pZM0n_v3MkZpSjVRjm55-LuCE2IYE?usp=sharing ) to demonstrate the workflow for using the bird model. diff --git a/docs/source/deepforest_docs/introduction/index.rst b/docs/introduction/index.rst similarity index 87% rename from docs/source/deepforest_docs/introduction/index.rst rename to docs/introduction/index.rst index 301248681..5e6b44bbb 100644 --- a/docs/source/deepforest_docs/introduction/index.rst +++ b/docs/introduction/index.rst @@ -8,4 +8,3 @@ Welcome to the introduction section. :caption: Contents: landing - getting_started diff --git a/docs/source/deepforest_docs/introduction/landing.md b/docs/introduction/landing.md similarity index 99% rename from docs/source/deepforest_docs/introduction/landing.md rename to docs/introduction/landing.md index 5b7e0108d..284fc1603 100644 --- a/docs/source/deepforest_docs/introduction/landing.md +++ b/docs/introduction/landing.md @@ -2,7 +2,7 @@ DeepForest is a python package for training and predicting ecological objects in airborne imagery. DeepForest comes with models for immediate use and finetuning. Both are single class modules that can be extended to species classification based on new data. Users can extend these models by annotating and training custom models. -![](../../../../www/image.png) +![](../../www/image.png) ## How does deepforest work? diff --git a/docs/source/deepforest_docs/make.bat b/docs/make.bat similarity index 100% rename from docs/source/deepforest_docs/make.bat rename to docs/make.bat diff --git a/docs/source/deepforest_docs/related_work/index.rst b/docs/related_work/index.rst similarity index 100% rename from docs/source/deepforest_docs/related_work/index.rst rename to docs/related_work/index.rst diff --git a/docs/source/deepforest_docs/related_work/use.md b/docs/related_work/use.md similarity index 100% rename from docs/source/deepforest_docs/related_work/use.md rename to docs/related_work/use.md diff --git a/docs/source/deepforest_docs/requirements.txt b/docs/requirements.txt similarity index 100% rename from docs/source/deepforest_docs/requirements.txt rename to docs/requirements.txt diff --git a/docs/source/deepforest_docs/source/deepforest.data.rst b/docs/source/deepforest.data.rst similarity index 100% rename from docs/source/deepforest_docs/source/deepforest.data.rst rename to docs/source/deepforest.data.rst diff --git a/docs/source/deepforest_docs/source/deepforest.rst b/docs/source/deepforest.rst similarity index 100% rename from docs/source/deepforest_docs/source/deepforest.rst rename to docs/source/deepforest.rst diff --git a/docs/source/deepforest_docs/developer_resources/authors.rst b/docs/source/deepforest_docs/developer_resources/authors.rst deleted file mode 100644 index 84fb6da82..000000000 --- a/docs/source/deepforest_docs/developer_resources/authors.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../../../AUTHORS.rst diff --git a/docs/source/deepforest_docs/developer_resources/history.rst b/docs/source/deepforest_docs/developer_resources/history.rst deleted file mode 100644 index 20cf9a864..000000000 --- a/docs/source/deepforest_docs/developer_resources/history.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../../../HISTORY.rst diff --git a/docs/source/deepforest_docs/getting_started/getting_started.md b/docs/source/deepforest_docs/getting_started/getting_started.md deleted file mode 100644 index 34a68bb54..000000000 --- a/docs/source/deepforest_docs/getting_started/getting_started.md +++ /dev/null @@ -1,83 +0,0 @@ -# Getting started - -# Demo - -[Try out the DeepForest models online!](https://huggingface.co/spaces/weecology/deepforest-demo) - -## How do I use a pretrained model to predict an image? - -```python -from deepforest import main -from deepforest import get_data -import matplotlib.pyplot as plt - -model = main.deepforest() -model.use_release() - -sample_image_path = get_data("OSBS_029.png") -img = model.predict_image(path=sample_image_path, return_plot=True) - -#predict_image returns plot in BlueGreenRed (opencv style), but matplotlib likes RedGreenBlue, switch the channel order. Many functions in deepforest will automatically perform this flip for you and give a warning. -plt.imshow(img[:,:,::-1]) -``` - -![](../../../../www/getting_started1.png) - - -** please note that this video was made before the deepforest-pytorch -> deepforest name change. ** - -
- -For single images, ```predict_image``` can read an image from memory or file and return predicted bounding boxes. - -### Sample data - -DeepForest comes with a small set of sample data that can be used to test out the provided examples. The data resides in the DeepForest data directory. Use the `get_data` helper function to locate the path to this directory, if needed. - -```python -sample_image = get_data("OSBS_029.png") -sample_image -'/Users/benweinstein/Documents/DeepForest/deepforest/data/OSBS_029.png' -``` - -To use images other than those in the sample data directory, provide the full path for the images. - -```python -image_path = get_data("OSBS_029.png") -boxes = model.predict_image(path=image_path, return_plot = False) -``` - -``` ->>> boxes - xmin ymin xmax ymax label score image_path -0 330.0 342.0 373.0 391.0 Tree 0.802979 OSBS_029.png -1 216.0 206.0 248.0 242.0 Tree 0.778803 OSBS_029.png -2 325.0 44.0 363.0 82.0 Tree 0.751573 OSBS_029.png -3 261.0 238.0 296.0 276.0 Tree 0.748605 OSBS_029.png -4 173.0 0.0 229.0 33.0 Tree 0.738210 OSBS_029.png -5 258.0 198.0 291.0 230.0 Tree 0.716250 OSBS_029.png -6 97.0 305.0 152.0 363.0 Tree 0.711664 OSBS_029.png -7 52.0 72.0 85.0 108.0 Tree 0.698782 OSBS_029.png -``` - -### Predict a tile - -Large tiles covering wide geographic extents cannot fit into memory during prediction and would yield poor results due to the density of bounding boxes. Often provided as geospatial .tif files, remote sensing data is best suited for the ```predict_tile``` function, which splits the tile into overlapping windows, performs prediction on each of the windows, and then reassembles the resulting annotations. - -Let's show an example with a small image. For larger images, patch_size should be increased. - -```python -raster_path = get_data("OSBS_029.tif") -# Window size of 300px with an overlap of 25% among windows for this small tile. -predicted_raster = model.predict_tile(raster_path, return_plot = True, patch_size=300,patch_overlap=0.25) - -# View boxes overlayed when return_plot=True, when False, boxes are returned. -plt.imshow(predicted_raster) -plt.show() -``` - -** Please note the predict tile function is sensitive to patch_size, especially when using the prebuilt model on new data** - -We encourage users to try out a variety of patch sizes. For 0.1m data, 400-800px per window is appropriate, but it will depend on the density of tree plots. For coarser resolution tiles, >800px patch sizes have been effective, but we welcome feedback from users using a variety of spatial resolutions. - - diff --git a/docs/source/deepforest_docs/index.rst b/docs/source/deepforest_docs/index.rst deleted file mode 100644 index 9b04191a6..000000000 --- a/docs/source/deepforest_docs/index.rst +++ /dev/null @@ -1,61 +0,0 @@ -Welcome to DeepForest! -********************** - -DeepForest is a python package for airborne object detection and classification. - -**Tree crown prediction using DeepForest** - -.. image:: ../../../www/OSBS_sample.png - -**Bird detection using DeepForest** - -.. image:: ../../../www/bird_panel.jpg - - -Why DeepForest? -=============== - -Observing the abundance and distribution of individual organisms is one of the foundations of ecology. Connecting broad-scale changes in organismal ecology, such as those associated with climate change, shifts in land use, and invasive species require fine-grained data on individuals at wide spatial and temporal extents. - -To capture these data, ecologists are turning to airborne data collection from uncrewed aerial vehicles, piloted aircraft, and earth-facing satellites. Computer vision, a type of image-based artificial intelligence, has become a reliable tool for converting images into ecological information by detecting and classifying ecological objects within airborne imagery. - -There have been many studies demonstrating that, with sufficient labeling, computer vision can yield near-human-level performance for ecological analysis. However, almost all of these studies rely on isolated computer vision models that require extensive technical expertise and human data labeling. -In addition, the speed of innovation in computer vision makes it difficult for even experts to keep up with new innovations. - -To address these challenges, the next phase of ecological computer vision needs to reduce the technical barriers and move towards general models that can be applied across space, time, and taxa. - -DeepForest aims to be **simple**, **customizable**, and **modular**. DeepForest makes an effort to keep unnecessary complexity hidden from the ordinary user by developing straightforward functions like "predict_tile." The majority of machine learning projects actually fail due to poor data and project management, not clever models. DeepForest makes an effort to generate straightforward defaults, utilize already-existing labeling tools and interfaces, and minimize the effect of learning new APIs and code. - -Where can I get help, learn from others, and report bugs? -========================================================= - -Given the enormous array of forest types and image acquisition environments, it is unlikely that your image will be perfectly predicted by a prebuilt model. Below are some tips and some general guidelines to improve predictions. - -Get suggestions on how to improve a model by using the [discussion board](https://github.com/weecology/DeepForest/discussions). Please be aware that only feature requests or bug reports should be posted on the issues page. The most helpful thing you can do is leave feedback on DeepForest `issue page`_. No feature or issue, or positive affirmation is too small. Please do it now! - - -`Source code`_ is available on GitHub. - -.. toctree:: - :maxdepth: 2 - - introduction/index - installation_and_setup/index - getting_started/index - training_and_evaluation/index - data_annotation/index - advanced_features/index - developer_resources/index - deepforestr - source/modules.rst - related_work/index - - -Indices and tables -================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - -.. _issue page: https://github.com/weecology/DeepForest/issues -.. _Source code: https://github.com/weecology/DeepForest.git diff --git a/docs/source/index.rst b/docs/source/index.rst index bb8aa2aac..59be501ea 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,9 +1,61 @@ -:orphan: +Welcome to DeepForest! +********************** -DeepForest -======================== +DeepForest is a python package for airborne object detection and classification. + +**Tree crown prediction using DeepForest** + +.. image:: ../../www/OSBS_sample.png + +**Bird detection using DeepForest** + +.. image:: ../../www/bird_panel.jpg + + +Why DeepForest? +=============== + +Observing the abundance and distribution of individual organisms is one of the foundations of ecology. Connecting broad-scale changes in organismal ecology, such as those associated with climate change, shifts in land use, and invasive species require fine-grained data on individuals at wide spatial and temporal extents. + +To capture these data, ecologists are turning to airborne data collection from uncrewed aerial vehicles, piloted aircraft, and earth-facing satellites. Computer vision, a type of image-based artificial intelligence, has become a reliable tool for converting images into ecological information by detecting and classifying ecological objects within airborne imagery. + +There have been many studies demonstrating that, with sufficient labeling, computer vision can yield near-human-level performance for ecological analysis. However, almost all of these studies rely on isolated computer vision models that require extensive technical expertise and human data labeling. +In addition, the speed of innovation in computer vision makes it difficult for even experts to keep up with new innovations. + +To address these challenges, the next phase of ecological computer vision needs to reduce the technical barriers and move towards general models that can be applied across space, time, and taxa. + +DeepForest aims to be **simple**, **customizable**, and **modular**. DeepForest makes an effort to keep unnecessary complexity hidden from the ordinary user by developing straightforward functions like "predict_tile." The majority of machine learning projects actually fail due to poor data and project management, not clever models. DeepForest makes an effort to generate straightforward defaults, utilize already-existing labeling tools and interfaces, and minimize the effect of learning new APIs and code. + +Where can I get help, learn from others, and report bugs? +========================================================= + +Given the enormous array of forest types and image acquisition environments, it is unlikely that your image will be perfectly predicted by a prebuilt model. Below are some tips and some general guidelines to improve predictions. + +Get suggestions on how to improve a model by using the [discussion board](https://github.com/weecology/DeepForest/discussions). Please be aware that only feature requests or bug reports should be posted on the issues page. The most helpful thing you can do is leave feedback on DeepForest `issue page`_. No feature or issue, or positive affirmation is too small. Please do it now! + + +`Source code`_ is available on GitHub. .. toctree:: :maxdepth: 2 - deepforest_docs/index + ../introduction/index + ../installation_and_setup/index + ../getting_started/index + ../training_and_evaluation/index + ../data_annotation/index + ../advanced_features/index + ../developer_resources/index + ../deepforestr + modules.rst + ../related_work/index + + +Indices and tables +================== +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +.. _issue page: https://github.com/weecology/DeepForest/issues +.. _Source code: https://github.com/weecology/DeepForest.git diff --git a/docs/source/deepforest_docs/source/modules.rst b/docs/source/modules.rst similarity index 100% rename from docs/source/deepforest_docs/source/modules.rst rename to docs/source/modules.rst diff --git a/docs/source/deepforest_docs/training_and_evaluation/Evaluation.md b/docs/training_and_evaluation/Evaluation.md similarity index 100% rename from docs/source/deepforest_docs/training_and_evaluation/Evaluation.md rename to docs/training_and_evaluation/Evaluation.md diff --git a/docs/source/deepforest_docs/training_and_evaluation/better.md b/docs/training_and_evaluation/better.md similarity index 97% rename from docs/source/deepforest_docs/training_and_evaluation/better.md rename to docs/training_and_evaluation/better.md index c9827a114..4840be82e 100644 --- a/docs/source/deepforest_docs/training_and_evaluation/better.md +++ b/docs/training_and_evaluation/better.md @@ -13,14 +13,14 @@ The prebuilt model was trained on 10cm data at 400px crops. The model is sensiti tile = model.predict_tile("/Users/ben/Desktop/test.jpg",return_plot=True,patch_overlap=0,iou_threshold=0.05,patch_size=400) ``` -![](../../../../www/example_patch400.png) +![](../../www/example_patch400.png) Acceptable, but not ideal. Here is 1000 px patches. -![](../../../../www/example_patch1000.png) +![](../../www/example_patch1000.png) improved. diff --git a/docs/source/deepforest_docs/training_and_evaluation/index.rst b/docs/training_and_evaluation/index.rst similarity index 100% rename from docs/source/deepforest_docs/training_and_evaluation/index.rst rename to docs/training_and_evaluation/index.rst diff --git a/docs/source/deepforest_docs/training_and_evaluation/training.md b/docs/training_and_evaluation/training.md similarity index 100% rename from docs/source/deepforest_docs/training_and_evaluation/training.md rename to docs/training_and_evaluation/training.md diff --git a/setup.py b/setup.py index ee6f62c54..5dc566b48 100644 --- a/setup.py +++ b/setup.py @@ -63,9 +63,11 @@ license=LICENCE, packages=find_packages(), include_package_data=True, - install_requires=['albumentations>=1.0.0', 'aiolimiter', 'aiohttp', 'docformatter', 'huggingface_hub', - 'geopandas', 'matplotlib', 'nbqa', 'numpy', 'opencv-python-headless>=4.5.4', 'pandas', 'Pillow>6.2.0', - 'progressbar2', 'pycocotools', 'pydata-sphinx-theme', 'Pygments', 'pytorch-lightning>=1.5.8', 'rasterio', - 'recommonmark', 'rtree', 'scipy>1.5', 'six', 'slidingwindow', 'sphinx', 'supervision', 'torch', - 'torchvision>=0.13', 'tqdm', 'xmltodict', 'geopandas'], + install_requires=[ + "albumentations>=1.0.0", "aiolimiter", "aiohttp", "docformatter", "huggingface_hub", "geopandas", "matplotlib", "nbqa", "numpy", + "'opencv-python-headless>=4.5.4'", "pandas", "Pillow>6.2.0", "progressbar2", "pycocotools", "pydata-sphinx-theme", "Pygments", + "pytorch-lightning>=1.5.8", "rasterio", "recommonmark", "rtree", "scipy>1.5", + "six", "slidingwindow", "sphinx", "supervision", "torch", "torchvision>=0.13", "tqdm", + "xmltodict","geopandas" + ], zip_safe=False)