Generate Plan2Scene compatible scene.json files from raster-to-vector outputs.
pip install -r requirements.txt
To convert a raster-to-vector output to the scene.json format, run the following command.
export PYTHONPATH=./code/src
python convert.py [Output path] [Path to raster-to-vector output file] --scale-factor [Scale factor]
# The scale factor is used to convert pixel coordinates provided by raster-to-vector into meters.
# Example
python convert.py ./outputs/ ./sample_input/sample_r2v_output.txt --scale-factor 0.08
Note: This tool supports processing of the R2V annotation format as well. You can find many example floorplans in this format in the R2V code repository.
The floorplan annotator they used is also available in the same repository.
The R2V annotation format is very similar to the R2V output format. However, the room type labels are represented as axis-aligned bounding boxes instead of properties of the wall line segment.
If you are processing an r2v annotation file, make sure to provide --r2v-annot
flag as a command-line argument.
The outputs directory has the following files:
- *.scene.json file describing the house architecture.
- *.objectaabb.json file describing axis-aligned bounding boxes of object icons.
- Sketches of floorplan and the rooms. Use these for debugging purposes.
-
To preview the *.scene.json file with house architecture in 3D, use the scene-viewer of SmartScenesToolkit.
-
We generate 2D sketches that preview the annotations. Use these to identify errors in the parsed floorplan such as missing room-door-room edges.
The following generated sketch shows room 4 of the provided sample house.
The focused room (room4) is colored green. Its door connected neighbors are gray colored. The doors are indicated by blue lines and windows are indicated by yellow lines.
Please refer to the intructions provided in the Plan2Scene code repository.
In this section, we describe different configurations that you may want to change.
- Update room_types.json file with the room type labels predicted by raster-to-vector. Make sure the labels are correctly ordered.
- Configurations used to generate scene.json files are available in the arch_defaults.json file.
- Configurations used to parse raster-to-vector outputs are available in the parser_config.json file