OpenDroneMap-NodeODM/README.md

179 wiersze
6.8 KiB
Markdown
Czysty Zwykły widok Historia

2018-11-07 01:42:52 +00:00
# NodeODM
2017-04-26 21:46:48 +00:00
2018-11-30 19:09:23 +00:00
[![Build Status](https://travis-ci.org/OpenDroneMap/NodeODM.svg?branch=master)](https://travis-ci.org/OpenDroneMap/NodeODM)
2017-03-30 16:28:21 +00:00
2020-04-04 16:28:58 +00:00
NodeODM is a [standard API specification](https://github.com/OpenDroneMap/NodeODM/blob/master/docs/index.adoc) for processing aerial images with engines such as [ODM](https://github.com/OpenDroneMap/ODM). The API is used by clients such as [WebODM](https://github.com/OpenDroneMap/WebODM), [CloudODM](https://github.com/OpenDroneMap/CloudODM) and [PyODM](https://github.com/OpenDroneMap/PyODM). This repository contains a performant, production-ready reference implementation written in NodeJS.
2016-07-30 19:57:19 +00:00
2020-04-04 16:27:47 +00:00
![image](https://user-images.githubusercontent.com/1951843/78455986-4805ab80-766f-11ea-8a79-1691e062600c.png)
2016-07-18 21:36:12 +00:00
## Getting Started
2018-11-07 01:42:52 +00:00
We recommend that you setup NodeODM using [Docker](https://www.docker.com/).
2016-07-18 21:36:12 +00:00
* From the Docker Quickstart Terminal (Windows / OSX) or from the command line (Linux) type:
```
2019-05-02 01:41:41 +00:00
docker run -p 3000:3000 opendronemap/nodeodm
2016-07-18 21:36:12 +00:00
```
* If you're on Windows/OSX, find the IP of your Docker machine by running this command from your Docker Quickstart Terminal:
```
docker-machine ip
```
Linux users can connect to 127.0.0.1.
* Open a Web Browser to `http://<yourDockerMachineIp>:3000`
* Load [some images](https://github.com/OpenDroneMap/ODMdata)
2016-07-18 23:20:06 +00:00
* Press "Start Task"
* Go for a walk :)
2016-07-18 21:36:12 +00:00
2018-11-07 01:45:55 +00:00
If the computer running NodeODM is using an old or 32bit CPU, you need to compile OpenDroneMap from sources and setup NodeODM natively. You cannot use docker. Docker images work with CPUs with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support or higher. Seeing a `Illegal instruction` error while processing images is an indication that your CPU is too old.
2018-01-18 15:59:58 +00:00
2016-09-17 00:34:13 +00:00
## API Docs
2018-11-07 01:45:55 +00:00
See the [API documentation page](https://github.com/OpenDroneMap/NodeODM/blob/master/docs/index.adoc).
2018-08-04 20:28:00 +00:00
Some minor breaking changes exist from version `1.x` to `2.x` of the API. See [migration notes](https://github.com/OpenDroneMap/NodeODM/blob/master/MIGRATION.md).
2019-01-12 22:15:38 +00:00
## Run Tasks from the Command Line
You can use [CloudODM](https://github.com/OpenDroneMap/CloudODM) to run tasks with NodeODM from the command line.
2018-08-04 20:28:00 +00:00
## Using an External Hard Drive
If you want to store results on a separate drive, map the `/var/www/data` folder to the location of your drive:
```bash
2019-05-02 01:44:45 +00:00
docker run -p 3000:3000 -v /mnt/external_hd:/var/www/data opendronemap/nodeodm
2018-08-04 20:28:00 +00:00
```
This can be also used to access the computation results directly from the file system.
2016-09-17 00:34:13 +00:00
2021-05-20 09:47:12 +00:00
## Using GPU Acceleration for SIFT processing inside NodeODM
Since the ODM has support [of GPU acceleration](https://github.com/OpenDroneMap/ODM#gpu-acceleration) you can use another base image for GPU processing.
To use this feature, you need to use the `opendronemap/nodeodm:gpu` docker image instead of `opendronemap/nodeodm` and you need to pass the `--gpus all` flag:
```bash
docker run -p 3000:3000 --gpus all opendronemap/nodeodm:gpu
```
The SIFT GPU implementation is OpenCL-based, so should work with most graphics card (not just NVIDIA).
If you have an NVIDIA card, you can test that docker is recognizing the GPU by running:
```
docker run --rm --gpus all nvidia/cuda:10.0-base nvidia-smi
```
If you see an output that looks like this:
```
Fri Jul 24 18:51:55 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
```
You're in good shape!
See https://github.com/NVIDIA/nvidia-docker and https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker for information on docker/NVIDIA setup.
2016-07-18 21:36:12 +00:00
### Run it Natively
2018-11-07 01:42:52 +00:00
If you are already running [ODM](https://github.com/OpenDroneMap/ODM) on Ubuntu natively you can follow these steps:
2019-06-08 18:13:17 +00:00
1) Install Entwine: https://entwine.io/quickstart.html#installation
2020-09-10 16:55:22 +00:00
2) Install node.js, npm dependencies, 7zip and unzip:
```bash
2016-07-18 21:36:12 +00:00
sudo curl --silent --location https://deb.nodesource.com/setup_6.x | sudo bash -
2020-09-10 16:55:22 +00:00
sudo apt-get install -y nodejs python-gdal p7zip-full unzip
2018-11-07 01:45:55 +00:00
git clone https://github.com/OpenDroneMap/NodeODM
cd NodeODM
2016-07-18 23:04:03 +00:00
npm install
```
2018-11-07 01:42:52 +00:00
3) Start NodeODM
```bash
2016-07-18 21:36:12 +00:00
node index.js
```
You may need to specify your ODM project path to start the server:
```
node index.js --odm_path /home/username/OpenDroneMap
```
If you want to start node ODM on a different port you can do the following:
```
node index.js --port 8000 --odm_path /home/username/OpenDroneMap
```
For other command line options you can run:
```
node index.js --help
```
You can also specify configuration values via a JSON file:
```
node index.js --config config.default.json
```
Command line arguments always take precedence over the configuration file.
### Run it using PM2
The app can also be run as a background process using the [pm2 process manager](https://github.com/Unitech/pm2), which can also assist you with system startup scripts and process monitoring.
To install pm2, run (using `sudo` if required):
```shell
npm install pm2 -g
```
The app can then be started using
```shell
pm2 start processes.json
```
To have pm2 started on OS startup run
```shell
pm2 save
pm2 startup
```
and then run the command as per the instructions that prints out. If that command errors then you may have to specify the system (note that systemd should be used on CentOS 7). Note that if the process is not running as root (recommended) you will need to change `/etc/init.d/pm2-init.sh` to set `export PM2_HOME="/path/to/user/home/.pm2"`, as per [these instructions](
http://www.buildsucceeded.com/2015/solved-pm2-startup-at-boot-time-centos-7-red-hat-linux/)
You can monitor the process using `pm2 status`.
### Test Mode
If you want to make a contribution, but don't want to setup OpenDroneMap, or perhaps you are working on a Windows machine, or if you want to run automated tests, you can turn test mode on:
```
node index.js --test
```
While in test mode all calls to OpenDroneMap's code will be simulated (see the /tests directory for the mock data that is returned).
2016-07-18 21:50:41 +00:00
### Test Images
You can find some test drone images [here](https://github.com/dakotabenjamin/odm_data).
2016-07-18 21:50:41 +00:00
## What if I need more functionality?
2018-11-07 01:45:55 +00:00
NodeODM is meant to be a lightweight API. If you are looking for a more comprehensive solution to drone mapping, check out [WebODM](https://github.com/OpenDroneMap/WebODM), which uses NodeODM for processing.
2016-07-18 21:36:12 +00:00
## Contributing
2017-05-18 02:12:33 +00:00
Make a pull request for small contributions. For big contributions, please open a discussion first. Please use ES6 syntax while writing new Javascript code so that we can keep the code base uniform.
2016-07-18 21:36:12 +00:00
## Roadmap
2019-01-31 14:45:29 +00:00
See the [list of wanted features](https://github.com/OpenDroneMap/NodeODM/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+feature%22).