JOSM/Plugins/AutoBound
This plugin was developed as Vishal's Google Summer of Code 2019 project.
AutoBound is a plugin for JOSM that can generate nodes for the boundaries of buildings using aerial images using Deep Learning. It has two components built into JOSM - Data Collection and AutoBound. The Data Collection part is complete and functional. AutoBound's deep learning part is currently under development.
Components of AutoBound
AutoBound has two components:
- AutoBound Plugin
- AutoBound Server
AutoBound Plugin
The AutoBound plugin is the component that works with JOSM to get the data to be processed. It also has a feature to download data for model building/training. The plugin requires the AutoBound server to be running to work. The AutoBound feature is used to send an aerial image to the server which responds with nodes for the building in the image in OSM XML format.
AutoBound Server
The AutoBound Server provides the deep learning and data collection functionalities for AutoBound. This is provided through HTTP endpoints. The server provides the following endpoints:
- / - The root endpoint provides the deep learning functionality. It takes the image (base64 encoded), min and max latitude and longitudes in the selected area as parameters. The image is processed and the nodes generated are sent to the plugin in JOSM file format.
- /dataCollector - This endpoint provides the data collection functionality for AutoBound. It takes the image (base64 encoded), timestamp, id, Image Suffix, Min and Max East and North, dist100pixel, and nodes of the building as parameters. It uses the nodes to create a segmented image and saves the original image and segmented image to the corresponding directories. The rest of the parameters are saved to a csv file.
Setting up AutoBound
AutoBound Plugin
AutoBound plugin hasn't been added to the JOSM plugins repository. So, to use the plugin, clone this repository and follow the instructions provided in the README.
AutoBound Server
To run the AutoBound server, clone this repo. Then checkout to the development branch. Install the required packages mentioned in requirements.txt. Then run the file run.py to run the server. Check the wiki for more detailed instructions. The docker image for the server can be found here.
Using AutoBound
Run JOSM with AutoBound and make sure the server is running. The server will listen at http://localhost:5000 by default. This can be changed by modifying the run.py file. The plugin sends data to http://localhost:5000 by default. This can be modified in the Advanced Preferences of JOSM with the key name autoboundServerUrl.
AutoBound - Data Collection
To use the data collection functionality, download data from the OSM server and activate imagery of your choice. Use the Menu item Collect Data - AutoBound under the Tools menu. This will begin downloading and saving data.
AutoBound - Node Generation
To use the Node generation functionality, enable the AutoBound MapMode. Next, select the area in the MapView to send to the server. The server will process the image and generate nodes. The generated nodes will be added to a new/existing layer called "AutoBoundData".
Development Status
Going to be updated to work with newer versions of JOSM and improve functionality.
Issues with the model
The model currently in the server generates very bad results
The model has been improved and will be added to the plugin's server soon. See Discussion for updates.
Contributing to the plugin
If you would like to contribute code, documentation, or other assets you can do so through GitHub by forking the repository and sending a pull request (PR). You can also simply report issues (bugs), but please search for any previous reports first.
File an Issue
You can report bugs and feature requests to GitHub Issues. As mentioned please look for a similar existing issue before submitting a new one. Label issues with the corresponding labels
How to Submit a Pull Request
Pull requests are highly appreciated! Please follow the simple guidelines below.
- Fork the repository to your personal GitHub account.
- Create a topic branch for every separate change you make. The branch should have a short but explanatory name, such as "NewModel".
- Apply your changes, committing at logical breaks. Make sure your changes are well-tested.
- Push your branch to your personal account and create a pull request.
- Watch for comments or acceptance on your PR. The PR can be updated by just pushing to the original branch.
If you are submitting a PR with a new model, add some sample input and their corresponding segmented images generated by the model to the PR. Also, provide some metrics to help judge the model's performance. Make sure to update autoboundTraining.ipynb with your training method.
All the aerial images shown in this page is collected from OpenAerialMap