ubc-vision / StableKeypoints

Apache License 2.0
81 stars 6 forks source link

Question #6

Closed KerasQA closed 6 months ago

KerasQA commented 6 months ago

Hello

I saw that you shared a Google Colab code for allowing custom image input given below.

https://colab.research.google.com/drive/1ULz-HIR9LgzXL5Lr68Cn_HV4Fn6tMlBj?usp=sharing

Given an image of a multiple cars shown below for example, how can I specify that I want only one key point on a specific car in the image (e.g., red car in the bottom of the image).

020160322000524

HamadYA commented 6 months ago

Another question, if we assume we have an object detector that detected those cars, how can I put the keypoints one of the car only (e.g., red car in the bottom of the image).

HamadYA commented 6 months ago

Another question, if we assume we have an object detector that detected those cars, how can I put the keypoints one of the car only (e.g., red car in the bottom of the image). In more simple words, given a bounding box, how can I add the center keypoint on the object.

ehedlin commented 6 months ago

I have played around lightly with directing the keypoints given a criteria for a specific frame. What I did for that was only select keypoints whose argmax were within the mask for the specified frame. Currently it takes a random image from the provided images and sorts keypoints based on how close to a gaussian they are and selects the top k. You could discard keypoints that don't satisfy your criteria and I have found it will still work well.

In the case of selecting only the red car for a specific frame you could select a random image and sort the tokens as they currently are sorted, but then also run those same tokens on the first image and discard the ones whose argmax is outside of the red car. Then select the top k from the remaining tokens before localizing.