csxmli2016 / dmdnet Goto Github PK
View Code? Open in Web Editor NEWLearning Dual Memory Dictionaries for Blind Face Restoration
Learning Dual Memory Dictionaries for Blind Face Restoration
dmdnet still need dictionaries file, several G?
Please provide a way to convert to ONNX or make one available.
All instructions are executed, but the result is not saved, what could be the matter?
CUDA_VISIBLE_DEVICES=0 python main_test.py -s ./TestExamples/TestGenericRestoration/GenericLists.txt -d ./TestExamples/Results_TestGenericRestoration
Using device : cuda
Model params : 40.36M
Restoring test_face_orig.png with only generic restoration
There may be something wrong with the detected component locations. Continue...
File "/usr/local/lib/python3.9/site-packages/torch/nn/functional.py", line 3959, in interpolate
return torch._C._nn.upsample_bilinear2d(input, output_size, align_corners, scale_factors)
RuntimeError: Input and output sizes should be greater than 0, but got input (H: 0, W: 0) output (H: 40, W: 40)
Hello,sorry to bother you.I want to know the details about how to accomplish three stages Initialization,Forward Update,Backward Update during training DMDNet.
Before training DMDNet,should I do something about Generic Feature Extractor to finish Initialization stage
This is great work! Could you release the whole code? Thank you!
Img = cv2.resize(Img, (512,512), interpolation = cv2.INTER_AREA)
This is how it should be, cause current code is limiting bigger images than 512 res from processing which is very weird, not all 512 res image are actual 512 res
updated func
def read_img_tensor(img_path=None, return_landmark=True): #rgb -1~1
Img = cv2.imread(img_path, cv2.IMREAD_UNCHANGED) # BGR or G
if Img.ndim == 2:
Img = cv2.cvtColor(Img, cv2.COLOR_GRAY2RGB) # GGG
else:
Img = cv2.cvtColor(Img, cv2.COLOR_BGR2RGB) # RGB
Img = cv2.resize(Img, (512,512), interpolation = cv2.INTER_AREA)
ImgForLands = Img.copy()
Img = Img.transpose((2, 0, 1))/255.0
Img = torch.from_numpy(Img).float()
normalize(Img, [0.5,0.5,0.5], [0.5,0.5,0.5], inplace=True)
ImgTensor = Img.unsqueeze(0)
SelectPred = None
if return_landmark:
try:
PredsAll = FaceDetection.get_landmarks(ImgForLands)
except:
print('Error in detecting this face {}. Continue...'.format(img_path))
if PredsAll is None:
print('Warning: No face is detected in {}. Continue...'.format(img_path))
return ImgTensor, None
ins = 0
if len(PredsAll)!=1:
hights = []
for l in PredsAll:
hights.append(l[8,1] - l[19,1])
ins = hights.index(max(hights))
print('Warning: Too many faces are detected, only handle the largest one...')
SelectPred = PredsAll[ins]
return ImgTensor, SelectPred
I tried to mix up different faces like matt damon face from 0009 onto women faces, it did 0 difference to the image, if it would work, it would be his facial features on woman's face , am i right ?
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.