Using the flag "--use-opensfm-pointcloud" or "--opensfm-processes 1" with the docker instance of ODM


#1

I am having similar memory related issues as rmarkRCS and am running into the same problem as OrangOrangUtan, when I try to implement the flags using ODM on docker.

Where do I use the --use-opensfm-pointcloud or -opensfm-processes 1 flags when I am using the docker instance?

For example here:

docker run -it --rm \
    -v "$(pwd)/images:/code/images" \
    -v "$(pwd)/odm_georeferencing:/code/odm_georeferencing" \
    -v "$(pwd)/odm_meshing:/code/odm_meshing" \
    -v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
    -v "$(pwd)/odm_texturing:/code/odm_texturing" \
    -v "$(pwd)/opensfm:/code/opensfm" \
    -v "$(pwd)/smvs:/code/smvs" \
    opendronemap/opendronemap

#2

After the end of that line, in other words after opendronemap/opendronemap.


#3

When I do that I get this error:

docker run -it --rm \
>     -v "$(pwd)/images:/code/images" \
>     -v "$(pwd)/odm_georeferencing:/code/odm_georeferencing" \
>     -v "$(pwd)/odm_meshing:/code/odm_meshing" \
>     -v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
>     -v "$(pwd)/odm_texturing:/code/odm_texturing" \
>     -v "$(pwd)/opensfm:/code/opensfm" \
>     -v "$(pwd)/smvs:/code/smvs" \
>     opendronemap/opendronemap --use-opensfm-pointcloud
usage: run.py [options] <project name>
run.py: error: unrecognized arguments: --use-opensfm-pointcloud

However when I run without trying those flags it works fine except for after about 2 hours into the process the memory use skyrockets and the program exits. For instance this command:

docker run -it --rm \
>     -v "$(pwd)/images:/code/images" \
>     -v "$(pwd)/odm_georeferencing:/code/odm_georeferencing" \
>     -v "$(pwd)/odm_meshing:/code/odm_meshing" \
>     -v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
>     -v "$(pwd)/odm_texturing:/code/odm_texturing" \
>     -v "$(pwd)/opensfm:/code/opensfm" \
>     -v "$(pwd)/smvs:/code/smvs" \
>     opendronemap/opendronemap
[INFO]    Initializing OpenDroneMap app - Mon Oct 22 23:17:40  2018
[INFO]    Running ODM Load Dataset Cell
[DEBUG]   Loading dataset from: /code/images
[DEBUG]   /code/images
[DEBUG]   Loaded DJI_0384.JPG | camera: dji fc300x | dimensions: 4000 x 3000 | focal: 3.61 | ccd: 6.2 | lat: 38.3177966944 | lon: -123.072862861 | alt: -37.211

#4

Sorry. Try this flag: --use-opensfm-dense


#5

Thanks! That seems to have got me through the memory related issue.

Now I am having issues creating a DEM. I run this command to try to create one:

docker run -it --rm     -v "$(pwd)/images:/code/images"     
-v "$(pwd)/odm_georeferencing:/code/odm_georeferencing"    
-v "$(pwd)/odm_meshing:/code/odm_meshing"     
-v "$(pwd)/odm_orthophoto:/code/odm_orthophoto"     
-v "$(pwd)/odm_texturing:/code/odm_texturing"     
-v "$(pwd)/opensfm:/code/opensfm"     
-v "$(pwd)/smvs:/code/smvs"     opendronemap/opendronemap --use-opensfm-dense --rerun odm_dem

However I get this output:
[WARNING] DEM will not be generated

All [INFO] and [WARNING] lines copied below for reference:
[INFO] Initializing OpenDroneMap app - Tue Oct 23 17:17:38 2018
[INFO] Running ODM Load Dataset Cell
[INFO] Found 519 usable images
[INFO] Running ODM Load Dataset Cell - Finished
[INFO] Running ODM OpenSfM Cell
[WARNING] Found a valid OpenSfM reconstruction file in: /code/opensfm/reconstruction.json
[WARNING] Found a valid Bundler file in: /code/opensfm/reconstruction.json
[INFO] Running ODM OpenSfM Cell - Finished
[INFO] Running ODM Meshing Cell
[WARNING] Found a valid ODM Mesh file in: /code/odm_meshing/odm_mesh.ply
[WARNING] Found a valid ODM 2.5D Mesh file in: /code/odm_meshing/odm_25dmesh.ply
[INFO] Running ODM Meshing Cell - Finished
[INFO] Running MVS Texturing Cell
[WARNING] Found a valid ODM Texture file in: /code/odm_texturing/odm_textured_model.obj
[INFO] Running ODM Texturing Cell - Finished
[INFO] Running ODM Georeferencing Cell
[WARNING] Found a valid georeferenced model in: /code/odm_georeferencing/odm_georeferenced_model.ply
[INFO] Running georeferencing with OpenSfM transformation matrix
[INFO] Calculating cropping area and generating bounds shapefile from point cloud
[INFO] Running ODM Georeferencing Cell - Finished
[INFO] Running ODM DEM Cell
[INFO] Classify: False
[INFO] Create DSM: False
[INFO] Create DTM: False
[INFO] DEM input file /code/odm_georeferencing/odm_georeferenced_model.laz found: True
[WARNING] DEM will not be generated
[INFO] Running ODM DEM Cell - Finished
[INFO] Running ODM Orthophoto Cell
[WARNING] Found a valid orthophoto in: /code/odm_orthophoto/odm_orthophoto.png
[INFO] Running ODM OrthoPhoto Cell - Finished
[INFO] OpenDroneMap app finished - Tue Oct 23 17:23:57 2018


#6

Cool. Add the flag --dsm and it shouldn’t skip that step anymore.


#7

Okay, we are getting there, but still no DEM. How can I bind “the open_dem directory”?

Now I have ran this command:

docker run -it --rm -v “$(pwd)/images:/code/images”
-v “$(pwd)/odm_georeferencing:/code/odm_georeferencing”
-v “$(pwd)/odm_meshing:/code/odm_meshing”
-v “$(pwd)/odm_orthophoto:/code/odm_orthophoto”
-v “$(pwd)/odm_texturing:/code/odm_texturing”
-v “$(pwd)/opensfm:/code/opensfm”
-v “$(pwd)/smvs:/code/smvs” opendronemap/opendronemap --use-opensfm-dense --rerun odm_dem --dsm

And the output near the end is:

[INFO] Running ODM Georeferencing Cell - Finished
[INFO] Running ODM DEM Cell
[INFO] Classify: False
[INFO] Create DSM: True
[INFO] Create DTM: False
[INFO] DEM input file /code/odm_georeferencing/odm_georeferenced_model.laz found: True
[INFO] Creating odm_dem/dsm_r0.025 [idw] from 1 files
[DEBUG] running pdal pipeline -i /tmp/tmpDsTYfA.json > /dev/null 2>&1
[INFO] Creating odm_dem/dsm_r0.05 [idw] from 1 files
[DEBUG] running pdal pipeline -i /tmp/tmp385dT_.json > /dev/null 2>&1
[INFO] Creating odm_dem/dsm_r0.1 [idw] from 1 files
[DEBUG] running pdal pipeline -i /tmp/tmpgpiCfH.json > /dev/null 2>&1
[INFO] Completed odm_dem/dsm_r0.025 [idw] in 0:03:35.874535
[INFO] Completed odm_dem/dsm_r0.05 [idw] in 0:03:37.575822
[INFO] Completed odm_dem/dsm_r0.1 [idw] in 0:03:44.863483
[INFO] Starting gap-filling with nearest interpolation…
[INFO] Completed gap-filling to create odm_dem/dsm.tif in 0:01:27.725997
[DEBUG] running gdalwarp -cutline /code/odm_georeferencing/odm_georeferenced_model.bounds.shp -crop_to_cutline -co BLOCKXSIZE=512 -co COMPRESS=LZW -co TILED=YES -co NUM_THREADS=8 -co BLOCKYSIZE=512 /code/odm_dem/dsm.original.tif /code/odm_dem/dsm.tif --config GDAL_CACHEMAX 34.45%
Creating output file that is 7527P x 8727L.
Processing input file /code/odm_dem/dsm.original.tif.
Using internal nodata values (e.g. -9999) for image /code/odm_dem/dsm.original.tif.
Copying nodata values from source /code/odm_dem/dsm.original.tif to destination /code/odm_dem/dsm.tif.
0…10…20…30…40…50…60…70…80…90…100 - done.
[INFO] Running ODM DEM Cell - Finished
[INFO] Running ODM Orthophoto Cell
[WARNING] Found a valid orthophoto in: /code/odm_orthophoto/odm_orthophoto.png
[INFO] Running ODM OrthoPhoto Cell - Finished
[INFO] OpenDroneMap app finished - Tue Oct 23 20:10:00 2018

However I cannot find “/code/odm_dem/dsm.tif” or “/code/odm_dem/dsm.original.tif” anywhere on my computer even though the output seems to indicate that this was created.

According to this issue the problem seems to be that I need to bind “the open_dem directory”, however I cannot find any directions on how to do this step.


#8

Nvm I figured it out, still getting used to this docker stuff. All I had to do was add this line:

-v “$(pwd)/odm_dem:/code/odm_dem”