Hello!
I try to convert my Pandas DataFrame (BoundingBoxes) to a List of Tensors, or one single Tensor
After conversion it should look like:
(Tensor[K, 5] or List[Tensor[L, 4]]).
As described at roi_align
bboxes_tensor = torch.tensor([df.bbox], dtype=torch.float)
doesn’t work with roi_align
.
Any idea how to get the conversion done?
Example of how the DataFrame Bboxes of a random image could look like.
The amount of bboxes is varrying.
print(df.bbox)
0 [1056.16, 190.5, 1241.0, 374.0]
1 [359.43, 179.3, 516.3, 270.97]
2 [444.13, 163.92, 559.2, 247.04]
3 [870.59, 115.22, 1101.06, 213.85]
4 [724.49, 171.09, 790.5, 215.13]
5 [534.25, 166.2, 596.08, 216.76]
6 [709.81, 162.43, 765.7, 205.68]
7 [562.02, 166.42, 605.57, 206.89]
8 [600.19, 163.56, 633.57, 188.6]
Name: bbox, dtype: object