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
import random
import shutil
import unittest.mock
import warnings
import xml.etree.ElementTree as ET
from collections import Counter, defaultdict
......@@ -519,9 +518,21 @@ def imagenet(root, config):
]
num_children = 1
synsets.extend((0, "", "", "", num_children, [], 0, 0) for _ in range(5))
with warnings.catch_warnings():
# The warning is not for savemat, but rather for some internals savemet is using
warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning)
synsets = np.array(
synsets,
dtype=np.dtype(
[
("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")
......
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