Git Product home page Git Product logo

danielcho-hk / deep-vectorization-of-technical-drawings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vahe1994/deep-vectorization-of-technical-drawings

0.0 0.0 0.0 976 KB

Official Pytorch repository for Deep Vectorization of Technical Drawings https://arxiv.org/abs/2003.05471

License: Mozilla Public License 2.0

Python 59.82% Shell 0.75% Cuda 0.41% C++ 0.07% Jupyter Notebook 38.88% Dockerfile 0.07%

deep-vectorization-of-technical-drawings's Introduction

Deep Vectorization of Technical Drawings [Web page] [Paper] [Video] [Slides]

Official Pytorch repository for ECCV 2020 paper Deep Vectorization of Technical Drawings

alt text

Repository Structure

To make the repository user-friendly, we decided to stick with - module-like structure. The main modules are cleaning, vectorization, refinement, and merging(each module has an according to folder). Each folder has Readme with more details. Here is the brief content of each folder.

  • cleaning - model, script to train and run, script to generate synthetic data
  • vectorization - NN models, script to train
  • refinement - refinement module for curves and lines
  • merging - merging module for curves and lines
  • dataset - scripts to download ABC, PFP, cleaning datasets, scripts to modify data into patches, and memory-mapped them.
  • notebooks - a playground to show some function in action
  • utils - loss functions, rendering, metrics
  • scripts - scripts to run training and evaluation

Requirments

Linux system
Python 3

See requirments.txt and additional packages

cairo==1.14.12
pycairo==1.19.1
chamferdist==1.0.0

Compare

To compare with us without running code, you can download our results on the full pipeline on the test set for pfp and for abc.

Dataset

Scripts to download dataset are in folder dataset/.

  • For ABC,real datasets use download_dataset.sh
  • For PFP, use precision_floorplan_download.py
    Read ReadMe there for more instructions.

Notebooks

To show how some of the usability of the functions, there are several notebooks in the notebooks folder.

  1. Rendering notebook
  2. Dataset loading, model loading, model training, loss function loading
  3. Notebook that illustrates how to work with pretrained model and how to do refinement on lines(without merging)
  4. Notebook that illustrates how to work with pretrained model and how to do refinement on curves(without merging)

Models

Download pretrained models for curve and for line .

How to run

  1. Download models.
  2. Either use Dockerfile to create docker image with needed environment or just install requirements
  3. Run scripts/run_pipeline.sh with correct paths for trained model, data dir and output dir. Don't forget to chose primitive type and primitive count in one patch.

P.s. currently cleaning model not included there.

Dockerfile

Build the docker image:

docker build -t Dockerfile owner/name:version .

example:

docker build -t vahe1994/deep_vectorization:latest .

When running container mount folder with reporitory into code/, folder with datasets in data/ folder with logs in logs/

docker run --rm -it --shm-size 128G -p 4045:4045 --mount type=bind,source=/home/code,target=/code --mount type=bind,source=/home/data,target=/data --mount type=bind,source=/home/logs,target=/logs  --name=container_name owner/name:version /bin/bash

Anaconda with packages are installed in follder opt/ . Environement with packages that needed are installed in environment vect-env. . To activate it run in container

. /opt/.venv/vect-env/bin/activate/

How to train

Look at vectorization/srcipts/train_vectorizatrion

Citing

@InProceedings{egiazarian2020deep,
  title="Deep Vectorization of Technical Drawings",
  author="Egiazarian, Vage and Voynov, Oleg and Artemov, Alexey and Volkhonskiy, Denis and Safin, Aleksandr and Taktasheva, Maria and Zorin, Denis and Burnaev, Evgeny",
  booktitle="Computer Vision -- ECCV 2020",
  year="2020",
  publisher="Springer International Publishing",
  address="Cham",
  pages="582--598",
  isbn="978-3-030-58601-0"
}

deep-vectorization-of-technical-drawings's People

Contributors

artonson avatar dependabot[bot] avatar vahe1994 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.