GithubHelp home page GithubHelp logo

sevocrear / changeyourwalls Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 3.0 22.52 MB

Allows to change the walls by the given pattern. This program aims to help with your interior update

License: MIT License

Dockerfile 7.51% Python 92.49%
docker interior-design opencv-python patching perspective-transformation pytorch semantic-segmentation wall-changer

changeyourwalls's Introduction

ChangeYourWalls

Do you want to paint the walls or re-glue them altogether? But you're not quite sure they'll match the surroundings? This program allows to change the walls by the given pattern. This program aims to help with your interior update.

Requirements:

  • CUDA 9.2+

How to use

  • upload a pattern into demo/patterns dir
  • upload your interior image into demo/source dir
  • segment the interior with get_seg.py
  • run main.py, select four corners (top left, top-right, bottom-right, bottom-left) with Left Botton of your mouse.
    • Click middle mouse button to apply the pattern on the selected corners
    • Click right button to delete the last selected corner (if it doesn't seem correct)

You can either select rectangle wall parts one-by-one or just select the bounding four corners to apply the pattern.

See *.py --help to see additional info. Just play with it!

Build a docker

docker build --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" --build-arg UNAME="auto" -t mmseg_wall -f Dockerfile .

Run docker and get segmentation mask for the image

docker run --rm -it --gpus all --net=host --ipc=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/auto/.Xauthority -v $PWD:/home/auto/ mmseg_wall

Download the model and config

mim download mmsegmentation --config pspnet_r101-d8_480x480_80k_pascal_context_59 --dest models/

Get the mask of the interior (to mask selected objects (ex., a wall))

python3 get_seg.py --image demo/source/test.png --output demo/mask/test.png --obj_class wall --device cuda

get the pattern

python3 main.py --image demo/source/test.png --mask demo/mask/test.png --pattern demo/patterns/texture_1.jpg 

After you finish, just hit any botton. Results are saved in demo/results dir

TODO:

  • create tg bot @nikultimo
  • automate corners selection
  • play with various models. Improve the mask accuracy
  • Add online pattern change wrt selected corners
  • add weighted sum coefficients adjusting

References

changeyourwalls's People

Contributors

sevocrear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

changeyourwalls's Issues

adding automate corners selection?

Hello,
I have improved the mask for wall as well as for floor, but its very hard to do perspective transformation on the mask automatically. can you help me with this to a automatically select the corners

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.