Skip to content

How to extract information from method _inference within the Detect class? #14340

Answered by glenn-jocher
radiukpavlo asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

Thank you for your kind words and for your interest in the YOLOv8 project! We're thrilled to hear about your research and its innovative applications.

To extract intermediate data from the _inference method within the Detect class, you can indeed leverage PyTorch's register_forward_hook() function. However, since you need data from specific intermediate layers, you might need to modify the model slightly to make these layers accessible.

Here's a step-by-step approach to achieve this:

  1. Clone the Repository for Development: Ensure you have cloned the repository and set it up for development as per the quickstart guide.

  2. Modify the Model: You can modify the Detect class to include h…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@radiukpavlo
Comment options

@glenn-jocher
Comment options

Answer selected by radiukpavlo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants