Code Monkey home page Code Monkey logo

Comments (4)

Zhaoyi-Yan avatar Zhaoyi-Yan commented on July 17, 2024 1

Hi, it is not quite easy to explain unless you debug here: https://github.com/Zhaoyi-Yan/Shift-Net_pytorch/blob/master/models/shift_net/InnerShiftTripleFunction.py#L36,

        cosine, latter_windows, i_2, i_3, i_1 = bNonparm.cosine_similarity(former_all.clone(), latter_all.clone(), 1, stride, flag)

        _, indexes = torch.max(cosine, dim=2)

        mask_indexes = (flag==1).nonzero()[:, 1].view(ctx.bz, -1)

        non_mask_indexes = (flag==0).nonzero()[:, 1].view(ctx.bz, -1).gather(1, indexes)

        idx_b = torch.arange(ctx.bz).long().unsqueeze(1).expand(ctx.bz, mask_indexes.size(1))
        # set the elemnets of indexed by [mask_indexes, non_mask_indexes] to 1.
        # It is a batch version
        ctx.ind_lst[(idx_b, mask_indexes, non_mask_indexes)] = 1

_, indexes = torch.max(cosine, dim=2) is what you want to find and ctx.ind_lst is the matrix P.

from shift-net_pytorch.

tchaton avatar tchaton commented on July 17, 2024

Hey @Zhaoyi-Yan,

I hope you are doing well. I lost your contact. Would be great to connect.
I was wondering if you were interested in pursing inpainting but in different data format.

I am currently one the main contributor of TorchPoints3d: https://github.com/nicolas-chaulet/torch-points3d.

And I guess ShiftNet would be pretty interesting to perform in-painting / densification in 3d.

Best regards,
T.C

from shift-net_pytorch.

Sasharanko avatar Sasharanko commented on July 17, 2024

@Zhaoyi-Yan, thank you for your answer, it is really not easy and as I understand you're calculating Cosine Similarity for a pixel from missing region and then shift the most suitable pixel from know region in that place.

from shift-net_pytorch.

Zhaoyi-Yan avatar Zhaoyi-Yan commented on July 17, 2024

@tchaton
I am sorry that I have devoted myself to another area, so I am afraid I do not have time to performing inpainting in 3d.

from shift-net_pytorch.

Related Issues (20)

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.