Reduced GroundingDataset annotation unpacking speed (#18382)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Laughing-q <1185102784@qq.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
This commit is contained in:
parent
2aac80d980
commit
1051255c1e
1 changed files with 2 additions and 1 deletions
|
|
@ -323,7 +323,8 @@ class GroundingDataset(YOLODataset):
|
||||||
if box[2] <= 0 or box[3] <= 0:
|
if box[2] <= 0 or box[3] <= 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cat_name = " ".join([img["caption"][t[0] : t[1]] for t in ann["tokens_positive"]])
|
caption = img["caption"]
|
||||||
|
cat_name = " ".join([caption[t[0] : t[1]] for t in ann["tokens_positive"]])
|
||||||
if cat_name not in cat2id:
|
if cat_name not in cat2id:
|
||||||
cat2id[cat_name] = len(cat2id)
|
cat2id[cat_name] = len(cat2id)
|
||||||
texts.append([cat_name])
|
texts.append([cat_name])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue