Comments (3)
Please check the RGB channels of the PNG file you exported from Photoshop. One of the condition for the input is that if A = 0, then RGB should be (0,0,0). When you remove the background using Photoshop, it is most likely the case that it just sets the alpha channel to 0, leaving the RGB channel as white. Please clear the RGB channels.
from talking-head-anime-demo.
Hi, Great job! Thanks for your sharing.
The method works well in given examples, however, I get a worse result when using the picture generated by waifulabs.com.
The pic is from waifulabs.com, and I convert it to RGBA format with Photoshop. I alignment the face to 128x128 center box and resize the pic to 256x256
I believe it should be something wrong at the alignment,
so could you please share the alignment code?Here my code of alignment:
from PIL import Image import numpy as np import cv2 def alinment_image_lowhigh(image, high, low, save_path=None): ''' :param image: image path :param high: the bigger hight cordinate :param low: the smaller hight cordinate :param save_path: :return: ''' image = np.array(Image.open(image)) size = np.array(image.shape[:2]) # adjust face scale to 128 h = high - low scale = 128 / h high, low = high * scale, low * scale hc = (high + low) / 2 image = np.array(Image.fromarray(image).resize((int(size[0] * scale), int(size[1] * scale)))) # move face to center size = np.array(image.shape[:2]) delta = size[0] / 2 - hc M = np.float32([[1, 0, 0], [0, 1, delta]]) image = cv2.warpAffine(image, M, (size[1], size[0]), borderValue=(255, 255, 255)) image = Image.fromarray(image) image = image.resize(256, 256) if save_path is not None: image.save(save_path) image.show()
Thanks, your reply will be appreciated.
Hello BaldrLector~
You can use Gimp to export your PNG file (uncheck 'saving color value from trans pixs' when saving)
It should work!
from talking-head-anime-demo.
Please check the RGB channels of the PNG file you exported from Photoshop. One of the condition for the input is that if A = 0, then RGB should be (0,0,0). When you remove the background using Photoshop, it is most likely the case that it just sets the alpha channel to 0, leaving the RGB channel as white. Please clear the RGB channels.
You are right, after clear the RGB channels, the method work well.
Thanks!
from talking-head-anime-demo.
Related Issues (20)
- Cannot use all the GPU resource HOT 3
- About the image requirements. HOT 1
- didn't work on CUDA ver. 10.2 or higher HOT 5
- How to replace the Cuda driver in the AMD Product. HOT 1
- maɔv in 'puppeteer' HOT 2
- Is there some ways to save the module as mtn module file HOT 3
- V2 Models? HOT 1
- mouth movement unclear HOT 1
- could you release your training dataset? HOT 1
- About building anime dataset using your tool? HOT 1
- RuntimeError : CUDA out of memory. HOT 1
- Was this project demonstrated on Nvidia GTC 2021? HOT 1
- Can’t upload photo. HOT 1
- mouth ratio
- customed source image HOT 3
- why Bad results using colab? HOT 1
- Puppeteer Runtime Error HOT 3
- can't unloade photo HOT 14
- torch.device Metal Performance Shaders error HOT 2
- Project webpage error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talking-head-anime-demo.