Giter Club home page Giter Club logo

dmdnet's People

Contributors

csxmli2016 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

dmdnet's Issues

ONNX conversion

Please provide a way to convert to ONNX or make one available.

There may be something wrong with the detected component locations.

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)

Size of tensor a must match the size of tensor b

Good job on this enhancer; I'm wondering why it isn't more known...

While experimenting with it, I'm getting this error sometimes:
grafik

I couldn't find out where this comes from, is it because of different image dimensions or missing landmarks?

Could you release the whole code?

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

update this line

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

test with reference images doesnt really work

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 ?

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.