Giter Club home page Giter Club logo

Comments (4)

YuQi9797 avatar YuQi9797 commented on July 17, 2024
raccoon_face_tensor = torch.from_numpy(raccoon_face).permute(2, 0, 1).float()

input_tensor = raccoon_face_tensor.div(255).unsqueeze(0)

input_var = input_tensor.cuda()

the input_var is normalized (0~1).

But I don't know the target_var.

eye_coords_tensor = torch.Tensor([[[eye_x, eye_y]]])

target_tensor = (eye_coords_tensor * 2 + 1) / torch.Tensor(image_size) - 1

target_var = target_tensor.cuda()

If I want to use DSTNN, what do I need to do with the input and output?

from dsntnn.

anibali avatar anibali commented on July 17, 2024

This library offers the ability to choose whether you would like to calculate normalised coordinates or pixel coordinates via the normalized_coordinates parameter of the dsnt function. If you leave this as its default (False), then you will need to normalise the target. You can convert between normalised and pixel coordinates using the normalized_to_pixel_coordinates and pixel_to_normalized_coordinates functions.

from dsntnn.

YuQi9797 avatar YuQi9797 commented on July 17, 2024

I would like to ask, if I use DSTNN to calculate coordinates, do I need to do any standardization on my input and the heat map label?

At present, my image is standardized with [128,128, 128] as the mean value, [256,256,256] as the variance, and the label is the Gaussian distribution of the key points in the image position.

from dsntnn.

anibali avatar anibali commented on July 17, 2024

The heatmap which goes into dsnt is expected to be a valid probability distribution over locations, so all pixels must be be non-negative and sum to 1. You can achieve this using flat_softmax on the network's output. Please refer to the basic usage guide for an example. You do not need to create the Gaussian distribution for your targets, the functions in this library take 2D keypoint locations.

from dsntnn.

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.