GithubHelp home page GithubHelp logo

sysuyklin / freedrag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lpengyang/freedrag

0.0 0.0 0.0 102.33 MB

Official Implementation of FreeDrag

Home Page: https://lin-chen.site/projects/freedrag/

Shell 0.43% C++ 4.35% Python 84.26% CSS 1.14% Cuda 9.82%

freedrag's Introduction

FreeDrag: Point Tracking is Not What You Need for Interactive Point-based Image Editing

demo.mp4

Web Demo

Open in OpenXLab

Official implementation of FreeDrag: Point Tracking is Not What You Need for Interactive Point-based Image Editing.

This repo proposes FreeDrag, a novel interactive point-based image editing framework free of the laborious and unstable point tracking process🔥🔥🔥.

Abstract

To serve the intricate and varied demands of image editing, precise and flexible manipulation of image content is indispensable. Recently, DragGAN has achieved impressive editing results through point-based manipulation. However, we have observed that DragGAN struggles with miss tracking, where DragGAN encounters difficulty in effectively tracking the desired handle points, and ambiguous tracking, where the tracked points are situated within other regions that bear resemblance to the handle points. To deal with the above issues, we propose FreeDrag, which adopts a feature-oriented approach to free the burden on point tracking within the point-oriented methodology of DragGAN. The FreeDrag incorporates adaptive template features, line search, and fuzzy localization techniques to perform stable and efficient point-based image editing. Extensive experiments demonstrate that our method is superior to the DragGAN and enables stable point-based editing in challenging scenarios with similar structures, fine details, or under multi-point targets.

📜 News

[2023/7/31] The web demo in OpenXLab is available now.

[2023/7/28] The function of real image editing is available now.

[2023/7/15] Code of local demo is available now!💥

[2023/7/11] The paper and project page are released!

💡 Highlights

  • Local demo of FreeDrag
  • Web demo of FreeDrag
  • Diffusion-based FreeDrag
  • FreeDrag anything 3D

🛠️Usage

First clone our repository

git clone --depth=1 https://github.com/LPengYang/FreeDrag

To create a new environment, please follow the requirements of NVlabs/stylegan2-ada.

Notice: It is observed that the errors (setting up PyTorch plugin “bias_act_plugin“... Failed or “upfirdn2d_plugin“... Failed) may appear in some devices, we hope these potential solutions (1, 2, 3, 4) could be helpful in this case.

Then install the additional requirements

pip install -r requirements.txt

Then download the pre-trained models of stylegan2

bash download_models.sh

Notice: The first model (face model) could be downed very slowly in some cases. In this case, you can restart the download (works sometimes) or you can directly download it from this link, please download the correct model (ffhq-512×512) and renamed it as "faces.pkl" and manually put it in the created checkpoints file (after all the other models are downloaded).

Finally initialize the gradio platform for interactive point-based manipulation

CUDA_LAUNCH_BLOCKING=1 python FreeDrag_gradio.py

You can also upload your images and then edit them. For a high-quality image inversion, it is suggested to make sure that the resolution and style (such as layout) of the uploaded images are consistent with the generated images of corresponding model. The resolution of different model is listed as follows:

Model face horse elephant lion dog bicycle giraffe cat car church metface
Resolution 512 256 512 512 1024 256 512 512 512 256 1024

❤️Acknowledgments

License

All codes used or modified from StyleGAN2 are under the Nvidia Source Code License. The code related to the FreeDrag algorithm is only allowed for personal activity. For commercial use, please contact us.

✒️ Citation

If you find our work helpful for your research, please consider citing the following BibTeX entry.

@article{ling2023freedrag,
  title={FreeDrag: Point Tracking is Not You Need for Interactive Point-based Image Editing},
  author={Ling, Pengyang and Chen, Lin and Zhang, Pan and Chen, Huaian and Jin, Yi},
  journal={arXiv preprint arXiv:2307.04684},
  year={2023}
}

freedrag's People

Contributors

lpengyang avatar xiaoachen98 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.