GithubHelp home page GithubHelp logo

endo-yuki-t / usercontrollablelt Goto Github PK

View Code? Open in Web Editor NEW
276.0 276.0 32.0 2.14 MB

PyTorch implementation of ``User-Controllable Latent Transformer for StyleGAN Image Layout Editing'' [Computer Graphics Forum (Proc. of Pacific Graphics 2022)]

License: MIT License

Python 93.11% HTML 1.98% C++ 0.65% Cuda 4.26%

usercontrollablelt's People

Contributors

endo-yuki-t avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usercontrollablelt's Issues

Can't run flask_app.py, Error:arch_list[-1] += '+PTX' IndexError: list index out of range

system:Ubuntu

Successfully installed torch-1.9.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(base) root@autodl-container-acda11befa-2e27ffe1:~/autodl-tmp/UserControllableLT# python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/cat.pt
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
Traceback (most recent call last):
  File "interface/flask_app.py", line 15, in <module>
    from inference import demo
  File "/root/autodl-tmp/UserControllableLT/interface/inference.py", line 10, in <module>
    from models.StyleGANControler import StyleGANControler
  File "/root/autodl-tmp/UserControllableLT/./models/StyleGANControler.py", line 4, in <module>
    from models.stylegan2.model import Generator
  File "/root/autodl-tmp/UserControllableLT/./models/stylegan2/model.py", line 7, in <module>
    from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
  File "/root/autodl-tmp/UserControllableLT/./models/stylegan2/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/root/autodl-tmp/UserControllableLT/./models/stylegan2/op/fused_act.py", line 9, in <module>
    fused = load(
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1080, in load
    return _jit_compile(
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1293, in _jit_compile
    _write_ninja_file_and_build_library(
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1392, in _write_ninja_file_and_build_library
    _write_ninja_file_to_build_library(
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1783, in _write_ninja_file_to_build_library
    cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1562, in _get_cuda_arch_flags
    arch_list[-1] += '+PTX'
IndexError: list index out of range

image
image

win10

image
image

add ReadMe (How to set up in windows)

at Windows

Setting

git clone https://github.com/endo-yuki-t/UserControllableLT.git
cd UserControllableLT
conda create -n UserControllable python=3.8
conda activate UserControllable

pip install flask
pip install opencv-python einops ninja

#pip uninstall -y torch torchaudio torchvision
pip install torch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

Download the model and unzip it to 'UserControllableLT' location
unzip here
https://drive.google.com/u/0/uc?id=1lBL_J-uROvqZ0BYu9gmEcMCNyaPo9cBY&export=download
\UserControllableLT\pretrained_models

win+pause/ advanced system settings/ environment variables
Add this path to user (If VS 2022 BuildTool is not installed, you need to install it)
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64

Close cmd and rerun cmd

Run

conda activate UserControllable
python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/cat.pt
on browser
http://127.0.0.1:8000/

python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/anime.pt
python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/car.pt
python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/church.pt
python interface/flask_app.py --checkpoint_path=pretrained_models/latent_transformer/ffhq.pt

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.