Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What difference bettween these two type of tensor?

I am confused about the #2 type of tensor, how can I get its list type? For example, I can get the list type of predictions by predictions.tolist(), what about #2?

print(predictions) #return #1
print(bboxes) #return #2
>>>tensor([0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0], device='cuda:0') #1
>>>Boxes(tensor([[ 56.6679, 568.2880, 297.5019, 697.3653],             #2
        [315.3174, 556.3110, 555.8267, 720.8016],
        ...
        [ 56.5737, 134.1078, 497.3640, 165.2118]], device='cuda:0'))

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It seems like you are running an object detection model (e.g., YoLo, RCNN, etc.).
These models predict, for each detected box, its class (predictions in your case), and the bounding box this object occupies in the image (bboxes in your case).

The bboxes prediction uses a project-specific class Boxes. You should refer to the specific code you are running to see how this class is defined and how to iterate it.

Please note that in many object-detection frameworks, some of the returned bboxes are "background": that is they do not contain an actual object. Again, this is implementation dependant and you should know how the model you are using behaves.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading