Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get the dist, points, scores from the def non_maximum_suppression_inds function in the config ? #257

Open
Nal44 opened this issue Nov 10, 2023 · 7 comments

Comments

@Nal44
Copy link

Nal44 commented Nov 10, 2023

Hi Stardist team,

I am wondering how to access the dist, point and scores per object that is given by the non_maximum_suppression_inds function per object ? and how does it works ?

The idea behind it to try to use a reinforcment learning approach using agents that can try to maximize the IOU and F1 by changing several parameters for each agent including the distance and the probability for the each object.

How do I get the distance and probability with the metrics per object in the image (are these dist, and point ) or it is something else?
I would like to get these during training for each object at each epoch, so the agents can maximize the metrics, update the segmented objects, and go to the next iteration.

It is conceptual at this point but I am starting to work on it, any inputs, feedback or directions will help :) .
That will help a lot to design the RL approach,
Thanks a lot,

@maweigert
Copy link
Member

Hi,

If you want the vertex coordinates and probability for each retrieved object, they are provided in the additional prediction outputs:

y, details = model.predict_instances(normalize(x))

print(details['prob'].shape)
print(details['coord'].shape)

Is that what you want?

@Nal44
Copy link
Author

Nal44 commented Nov 14, 2023

Hi Martin,

yes ! thanks a lot
Basically , the RL algorythm will start after the predictions are made at each epoch, calculate the F1 , or else for each object, take actions to change the masks, replace the masks and go to the next iteration.

So I need the y and the x lists (or tuples ) of all objects, does the x works the same ?
such as :

x, details = model.normalize(x)

print(details['prob'].shape)
print(details['coord'].shape)

Once I get (understand) that , it should be straight forward :) .

Thanks
antho

@Nal44
Copy link
Author

Nal44 commented Dec 7, 2023

Hi ,

I am able to change the coords and points with the agent , now I want to re-calculate the probs for each new object.

How can I feed the updated coords/points values to re-calculate the probs?
Are the probs calculated by the NMS function ? or how the probs are calculated ?

Perhaps I could share in PM my code ?, any inputs will be greatly appreciated :)

Thanks a lot,
antho

@uschmidt83
Copy link
Member

Hi @Nal44, sorry for the late reply.

I'm sorry, but I don't understand what you're trying to do.

I am able to change the coords and points with the agent , now I want to re-calculate the probs for each new object.

Have you read the paper or looked at the poster?

The object probabilities and radial directions are predicted by the CNN, which are then used to create a set of object candidates, which the NMS reduces to the final set of predicted objects.

@Nal44
Copy link
Author

Nal44 commented Jan 15, 2024

Hi,

I' ll send you a PM on your email address with the file I am working on , that will be easier to explain and show the logic and the code.

Thanks a lot,
antho

@Nal44
Copy link
Author

Nal44 commented Jan 15, 2024

Hi both,

Pm sent with the corresponding files (2 emails ).
Please let me know :)
thanks a lot,
antho

@Nal44
Copy link
Author

Nal44 commented Jan 18, 2024

Hi,
Just checking did you receive my emails ?
thanks a lot,
Antho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants