GithubHelp home page GithubHelp logo

feigechuanshu / gfpgan-ncnn Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 15.0 2.4 MB

a naive NCNN implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration

CMake 2.59% C++ 86.72% C 10.69%

gfpgan-ncnn's People

Contributors

feigechuanshu 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gfpgan-ncnn's Issues

undefined reference to `ncnn::Mat::reshape(int, int, int, ncnn::Allocator*) const'

Comiler Mingw-w64
here log with errors

[100%] Linking CXX executable Z:\AI_SDK\CPP_GFPGAN\GFPGAN-ncnn-main\ncnn_gfpgan.
exe
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\ncnn_gfpg
an.dir\link.txt --verbose=1
"C:\Program Files\CMake\bin\cmake.exe" -E rm -f CMakeFiles\ncnn_gfpgan.dir/objec
ts.a
C:\mingw64\bin\ar.exe qc CMakeFiles\ncnn_gfpgan.dir/objects.a @CMakeFiles\ncnn_g
fpgan.dir\objects1.rsp
C:\mingw64\bin\x86_64-w64-mingw32-g++.exe -std=c++11 -pie -fPIE -fPIC -Wall -O3
-fopenmp -O3 -DNDEBUG -Wl,--whole-archive CMakeFiles\ncnn_gfpgan.dir/objects.a
-Wl,--no-whole-archive -o Z:\AI_SDK\CPP_GFPGAN\GFPGAN-ncnn-main\ncnn_gfpgan.exe
-Wl,--out-implib,Z:\AI_SDK\CPP_GFPGAN\GFPGAN-ncnn-main\libncnn_gfpgan.dll.a -Wl,
--major-image-version,0,--minor-image-version,0 @CMakeFiles\ncnn_gfpgan.dir\link
libs.rsp
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw
32/bin/ld.exe: CMakeFiles\ncnn_gfpgan.dir/objects.a(gfpgan.cpp.obj):gfpgan.cpp:(
.text+0x13e): undefined reference to ncnn::Net::Net()' C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw 32/bin/ld.exe: CMakeFiles\ncnn_gfpgan.dir/objects.a(gfpgan.cpp.obj):gfpgan.cpp:( .text+0xcc0): undefined reference to ncnn::Mat::reshape(int, int, int, ncnn::Allocator*) const'

如何生成ncnn的模型文件呢

你好,感谢你的工作
我是一名ncnn初学者,我在mac上做了简单修改,成功运行了你的代码
现在我想学习下如何ncnn模型文件是如何转成功的呢?

我目前的步骤为:
1、按如下修改GFPGan的stylegan2_clean_arch.py 中的代码

        # noise injection
        if noise is None:
            b, _, h, w = out.shape
            # noise = out.new_empty(b, 1, h, w).normal_()
            # noise = torch.empty(b, 1, h, w).cuda()
            # nn.init.normal_(noise)
            noise = torch.randn(b, 1, h, w).cuda()

2、将GFPGANCleanv1-NoCE-C2.pth 转为了onnx
3、然后应用了python -m onnxsim model.onnx model-sim.onnx
4、./onnx2ncnn model-sim.onnx encoder.param encoder.bin
报错

Gather not supported yet!
 \# axis=1
zsh: segmentation fault  ./onnx2ncnn model-sim.onnx encoder.param encoder.bin

Can not link target, missing file ncnn.lib

OS: Windows 10 21H1
Build tool: Visual Studio 2019

Commands:

mkdir build
cd build
cmake ..
cmake --build .

Result:

LINK : fatal error LNK1104: 无法打开文件“ncnn.lib” [D:\GFPGAN-ncnn\build\ncnn_gfpgan.vcxproj]

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.