Evaluate performance on benchmarks
masterTo evaluate the model's performance against a benchmark, run the evaluate.lua script:
th evaluate.lua -loadModel "model_path" -resultPath "path/to/save/results"repository·master·Indexed 20 days ago
https://github.com/art-programmer/floorplantransformationAn algorithm and toolset for converting rasterized floorplan images into high-precision vector-graphics representations. The project includes a Lua-based floorplan annotator, implementations in both Torch7 and PyTorch for model training and prediction, and utilities for generating 3D models via C++ or Python (Panda3D).
To evaluate the model's performance against a benchmark, run the evaluate.lua script:
th evaluate.lua -loadModel "model_path" -resultPath "path/to/save/results"You can train the network from the pretrained pose estimation network or resume training from a checkpoint.
To train from the pose estimation network:
th main.lua -loadPoseEstimationModel "path/to/pose_model"To resume training with the floorplan model:
th main.lua -loadModel "path/to/pretrained_model"| Option | Description |
|---|---|
-batchSize | Specifies the batch size |
-LR | Specifies the learning rate |
-nEpochs | Specifies the number of epochs |
-checkpointEpochInterval | Number of epochs between saving checkpoints |
useCheckpoint | Resuming logic: -1 (start fresh), 0 (default, resume if found), n (resume from nth checkpoint) |
Run the training process using train.py. You can use the --restore flag to manage checkpoints:
--restore=0--restore=1python train.py --restore=0To use the original Torch7 implementation, ensure you have the following requirements installed:
nn, cunn, cudnn, image, ffi, csvigo, penlight, opencv (may require compilation from source), and lunatic-python.numpy, Gurobi, and OpenCV (v3.4.1).3D model generation is available via C++ or Python.
Located in the popup/ folder. It uses the _popup.txt file generated by predict.lua.
cd popup/code/
cmake .
make
./popup_cli ../data/floorplan_1.txtData Format for popup_cli:
The input file (e.g., floorplan_1.txt) must follow this CSV-style format:
width height
[number of walls]
[Wall descriptions: x_1, y_1, x_2, y_2, left_room_type, right_room_type]
[Opening descriptions: x_1, y_1, x_2, y_2, 'door', dummy, dummy]
[Icon descriptions: x_1, y_1, x_2, y_2, icon_type, dummy, dummy]Note: To use the original image as a texture, place a .png file in the data folder with the same name as the data file (e.g., floorplan_1.png).
Located in the rendering/ folder.
python viewer.pypython rendering.pyTo use the annotator, you must first configure the input and output paths in the source code.
loadFilenames() function.loadFilenames() to specify the absolute or relative path of the floorplan image you wish to annotate, as well as the destination path where the annotation should be saved.qlua.# Standard execution
qlua main.lua
# Execution with full debugging output
qlua -lenv main.luaTo run the testing task instead of training, execute train.py with the --task=test flag.
python train.py --task=testThe algorithm requires two models to function:
checkpoint/ folder, or specify via -loadModel="path/to/model".PoseEstimation/ folder, or specify via -loadPoseEstimationModel.pytorch/ directory. It is generally easier to compile and run than the Torch7 version. This version also includes a free IP solver located at pytorch/IP.py that does not rely on Gurobi.To set up the environment for the PyTorch version of the floorplan transformation project, install the required packages using pip from the provided requirements file.
pip install -r requirements.txtTo convert a rasterized floorplan image into vector graphics, use the predict.lua script. This produces three outputs:
.txt file containing the vectorization results..png file containing the rendering image._popup.txt file used for generating 3D models.th predict.lua -loadModel "model_path" -floorplanFilename "image_path" -outputFilename "output_name"th predict.lua -loadModel "model_path" -floorplanFilename "path/to/the/floorplan/image" -outputFilename "output_filename"