bychen7 / face-restoration-tensorrt Goto Github PK
View Code? Open in Web Editor NEWA simple face restoration TensorRT deployment solution.
A simple face restoration TensorRT deployment solution.
The onnx you provided is gpen,When can we provide GFPGAN?
I convert GFPGAN1.4.onnx by running ./convert ../models/model.onnx -s ../models/model.engine
When I run ./demo ../models/model.engine -i ../images/test.png
I receive error like:
Loaded engine size: 372 MiB [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +368, now: CPU 0, GPU 368 (MiB) [MS] Running engine with multi stream info [MS] Number of aux streams is 7 [MS] Number of total worker streams is 8 [MS] The main stream provided by execute/enqueue calls is the first worker stream [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +437, now: CPU 0, GPU 805 (MiB) CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading 3: Cannot find binding of given name: output 3: [engine.cpp::getUserRegion::1312] Error Code 3: Internal Error (call of getBindingDataType with invalid bindingIndex -1) 3: [executionContext.cpp::enqueueInternal::795] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::enqueueInternal::795, condition: bindings[x] || nullBindingOK ) Cuda failure: 1 Aborted (core dumped)
I also change from 256 to 512:
Face-Restoration-TensorRT/face_restoration.hpp
Lines 21 to 22 in 298f55e
Any suggestion if I want to run this with GFPGAN 1.4.
Thanks in advance.
通过C++得到的engien模型, 如何用python程序推理?
The engien model obtained by C++, How to use Python program inference?
Hi, I'm not able to download models from Baidu (geo restricion). Could you please share the model using Google Drive?
Thank you in advance!
请问如何实现fp16的trt模型
I use cuda11.2 and tensorrt7.2.3.4 . But there are some errors.
Such as no member named ‘buildSerializedNetwork’
convert.cpp:37:45: error: ‘class nvinfer1::IBuilder’ has no member named ‘buildSerializedNetwork’
IHostMemory* serializedModel = builder->buildSerializedNetwork(*network, *c
Thanks, It's a great project. How this model to support dynamic batch. I set the model input first dim -1, and change code to create engine of tensorRT with method of dynamic shape . but I get error " [executionContext.cpp::validateInputBindings::1838] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::validateInputBindings::1838, condition: profileMaxDims.d[i] >= dimensions.d[i]. Supplied binding dimension [2,512,512,3] for bindings[0] exceed min ~ max range at index 0, maximum dimension in profile is 1, minimum dimension in profile is 1, but supplied dimension is 2" during inference .
I am getting a 700 error with the model-512.onnx model.
However the model.onnx works without any issue.
Anyone knows why or can reproduce this?
Any plan to release windows version. kinldy please update.
Thank you very much for your great work and sharing. Will there be any opportunity to support batch processing in the future to further improve the inference speed for a single image? Thanks again.
Can we directly convert gfpgan?
Hello, this project is fantastic, and I have a question: are there any plans to support CodeFormer? CodeFormer should be better than GFPGAN! Thank you!
Great job! when will it support face detection, face alignment, face parsing, and more, looking forward to it
My speed about: 40ms/frame
Environment:
OS: win11
device: laptop RTX4070
driver:537.13
CUDA:12.2
TensorRT:8.6.1
onnx file from:: https://github.com/harisreedhar/Face-Upscalers-ONNX/releases/tag/Models
Even if your project under window also: 40+ms/Frame.
any idea? thank you.
Great job!
the speed is much faster than pytorch origin model.
it seams the input/output size is 256x256,
is it possible to support 512x512 as the gfpgan officical release model?
I utilized the model weights provided by the repository. During the process of facial restoration and video generation, I observed noticeable pixelation effects on the teeth. My first question is about whether the model in the repository is GPEN or GFPGAN.
Second, to achieve an enhanced quality in facial restoration, particularly for teeth and mouth regions, which model would you recommend?
Thanks in advance.
I have successfully converted to ONNX, but I'm getting an error when converting to TensorRT. What should I do?
[TRT] [E] /ecd1/ecd1.0/ecd1.0.0/Conv: two inputs (data and weights) are allowed only in explicit-quantization mode.
In node 52 (parseGraph): INVALID_NODE: Invalid Node - /ecd1/ecd1.0/ecd1.0.0/Conv
/ecd1/ecd1.0/ecd1.0.0/Conv: two inputs (data and weights) are allowed only in explicit-quantization mode.
Hi @bychen7 ~ thx for sharing this work. Could you share the way of converting GPEN torch model to onnx model please?
Hi. Thanks for the great work. I am using a ubuntu machine with GPU and following your tutorial from step 1 to step 4. However, I encounter some problem when I am trying to run
./convert ../models/model.onnx -s ../models/model.engine
and return
error while loading shared libraries: libcublas.so.12: cannot open shared object file: No such file or directory
How do I solve this problem? Welcome to any advice.
Thank you
How to integrate the engine file in python, inorder to inference.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.