Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

objects prediction in script/extract_features.py #94

Open
BigodF opened this issue Apr 21, 2021 · 1 comment
Open

objects prediction in script/extract_features.py #94

BigodF opened this issue Apr 21, 2021 · 1 comment

Comments

@BigodF
Copy link

BigodF commented Apr 21, 2021

Following code for predicting object in script/extract_features.py

# Predict the class label using the scores
objects = torch.argmax(scores[keep_boxes][start_index:], dim=1)
cls_prob = torch.max(scores[keep_boxes][start_index:], dim=1)

my understanding is as following:
the size of scores[keep_boxes] is (100, 1601), start_index is for classes, prediction objects exclude foreground when it is 1.
the size of scores[keep_boxes][start_index:] is (99, 1601), what we want is (100, 1601) or (100, 1600) for prediction scores.
so the code should be writen like this if we want to compare the prediction scores of expected classes:

# Predict the class label using the scores
objects = torch.argmax(scores[keep_boxes][:, start_index:], dim=1)
cls_prob = torch.max(scores[keep_boxes][:, start_index:], dim=1)
@prajwalgatti
Copy link

Yes, this is a bug.

But doesn't affect the current pre-training/fine-tuning procedure as the objects and cls_prob data is discarded when converting to lmdb formatted data (see conversion code)

But I agree this should be corrected, regardless.

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

No branches or pull requests

2 participants