Unverified Commit 842e178a authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix prototype dataset imagenet mock data (#7009)

* fix prototype dataset imagenet mock data

* [REVERT ME] temporarily add prototype datasets test to CI

* Revert "[REVERT ME] temporarily add prototype datasets test to CI"

This reverts commit 7cafb5f01487c7625bcffd88e76832349b3e5055.
parent a8007dcd
...@@ -12,7 +12,6 @@ import pickle ...@@ -12,7 +12,6 @@ import pickle
import random import random
import shutil import shutil
import unittest.mock import unittest.mock
import warnings
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from collections import Counter, defaultdict from collections import Counter, defaultdict
...@@ -519,10 +518,22 @@ def imagenet(root, config): ...@@ -519,10 +518,22 @@ def imagenet(root, config):
] ]
num_children = 1 num_children = 1
synsets.extend((0, "", "", "", num_children, [], 0, 0) for _ in range(5)) synsets.extend((0, "", "", "", num_children, [], 0, 0) for _ in range(5))
with warnings.catch_warnings(): synsets = np.array(
# The warning is not for savemat, but rather for some internals savemet is using synsets,
warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) dtype=np.dtype(
savemat(data_root / "meta.mat", dict(synsets=synsets)) [
("ILSVRC2012_ID", "O"),
("WNID", "O"),
("words", "O"),
("gloss", "O"),
("num_children", "O"),
("children", "O"),
("wordnet_height", "O"),
("num_train_images", "O"),
]
),
)
savemat(data_root / "meta.mat", dict(synsets=synsets))
make_tar(root, devkit_root.with_suffix(".tar.gz").name, compression="gz") make_tar(root, devkit_root.with_suffix(".tar.gz").name, compression="gz")
else: # config["split"] == "test" else: # config["split"] == "test"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment