detectors.data packageο
Submodulesο
detectors.data.cifar_wrapper moduleο
detectors.data.cifarc moduleο
- class detectors.data.cifarc.CIFAR100_C(root: str, split: str, intensity: int, transform: Callable | None = None, download: bool = False)[source]ο
Bases:
CIFAR10_C- base_folder = 'CIFAR-100-C'ο
- corruptions = ['brightness', 'contrast', 'defocus_blur', 'elastic_transform', 'fog', 'frost', 'gaussian_blur', 'gaussian_noise', 'glass_blur', 'impulse_noise', 'jpeg_compression', 'motion_blur', 'pixelate', 'saturate', 'shot_noise', 'snow', 'spatter', 'speckle_noise', 'zoom_blur']ο
- file_md5 = '11f0ed0f1191edbf9fa23466ae6021d3'ο
- filename = 'CIFAR-100-C.tar'ο
- url = 'https://zenodo.org/record/3555552/files/CIFAR-100-C.tar'ο
- class detectors.data.cifarc.CIFAR10_C(root: str, split: str, intensity: int, transform: Callable | None = None, download: bool = False)[source]ο
Bases:
Dataset- base_folder = 'CIFAR-10-C'ο
- corruptions = ['brightness', 'contrast', 'defocus_blur', 'elastic_transform', 'fog', 'frost', 'gaussian_blur', 'gaussian_noise', 'glass_blur', 'impulse_noise', 'jpeg_compression', 'motion_blur', 'pixelate', 'saturate', 'shot_noise', 'snow', 'spatter', 'speckle_noise', 'zoom_blur']ο
- file_md5 = '56bf5dcef84df0e2308c6dcbcbbd8499'ο
- filename = 'CIFAR-10-C.tar'ο
- url = 'https://zenodo.org/record/2535967/files/CIFAR-10-C.tar'ο
detectors.data.cifarlt moduleο
Adapted from https://github.com/Megvii-Nanjing/BBN
- class detectors.data.cifarlt.CIFAR100LT(root: str, train: bool, transform: Callable | None = None, target_transform: Callable | None = None, download=True, imbalance_ratio=0.01, imb_type: Literal['exp', 'step'] = 'exp')[source]ο
Bases:
CIFAR10LT- base_folder = 'cifar-100-python'ο
- cls_num = 100ο
- filename = 'cifar-100-python.tar.gz'ο
- meta = {'filename': 'meta', 'key': 'fine_label_names', 'md5': '7973b15100ade9c7d40fb424638fde48'}ο
- test_list = [['test', 'f0ef6b0ae62326f3e7ffdfab6717acfc']]ο
- tgz_md5 = 'eb9058c3a382ffc7106e4002c42a8d85'ο
- train_list = [['train', '16019d7e3df5f24257cddd939b257f8d']]ο
- url = 'https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz'ο
detectors.data.constants moduleο
detectors.data.english_chars moduleο
- class detectors.data.english_chars.EnglishChars(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderIn the English language, Latin script (excluding accents) and Hindu-Arabic numerals are used. For simplicity we call this the βEnglishβ characters set. The dataset consists of:
64 classes (0-9, A-Z, a-z)
7705 characters obtained from natural images
3410 hand drawn characters using a tablet PC
62992 synthesised characters from computer fonts
This gives a total of over 74K images (which explains the name of the dataset).
- base_folder = 'chars74k'ο
- file_md5 = '85d157e0c58f998e1cda8def62bcda0d'ο
- filename = 'EnglishImg.tgz'ο
- images_folder = 'English/Img/GoodImg/Bmp/'ο
- url = 'http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/EnglishImg.tgz'ο
detectors.data.imagenet moduleο
- class detectors.data.imagenet.ImageNetA(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderImageNetA dataset.
- base_folder = 'imagenet-a'ο
- filename = 'imagenet-a.tar'ο
- tgz_md5 = 'c3e55429088dc681f30d81f4726b6595'ο
- url = 'https://people.eecs.berkeley.edu/~hendrycks/imagenet-a.tar'ο
- class detectors.data.imagenet.ImageNetC(root: str, split: str, intensity: int, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageNetACorrupted version of the ImageNet-1k dataset.
It contains the following subsets:
noise (21GB): gaussian_noise, shot_noise, and impulse_noise.
blur (7GB): defocus_blur, glass_blur, motion_blur, and zoom_blur.
weather (12GB): frost, snow, fog, and brightness.
digital (7GB): contrast, elastic_transform, pixelate, and jpeg_compression.
extra (15GB): speckle_noise, spatter, gaussian_blur, and saturate.
Paper: [https://arxiv.org/abs/1903.12261v1](https://arxiv.org/abs/1903.12261v1)
- base_folder_name = 'ImageNetC'ο
- corruptions = ['brightness', 'contrast', 'defocus_blur', 'elastic_transform', 'fog', 'frost', 'gaussian_blur', 'gaussian_noise', 'glass_blur', 'impulse_noise', 'jpeg_compression', 'motion_blur', 'pixelate', 'saturate', 'shot_noise', 'snow', 'spatter', 'speckle_noise', 'zoom_blur']ο
- split_list = ['blur', 'digital', 'extra', 'noise', 'weather']ο
- tgz_md5_list = ['2d8e81fdd8e07fef67b9334fa635e45c', '89157860d7b10d5797849337ca2e5c03', 'd492dfba5fc162d8ec2c3cd8ee672984', 'e80562d7f6c3f8834afb1ecf27252745', '33ffea4db4d93fe4a428c40a6ce0c25d']ο
- url_base = 'https://zenodo.org/record/2235448/files/'ο
- class detectors.data.imagenet.ImageNetCnpz(root: str, split: str, intensity: int, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
DatasetCorrupted version of the ImageNet-1k dataset saved in npz format.
- base_folder_name = 'ImageNetCnpz'ο
- corruptions = ['brightness', 'contrast', 'defocus_blur', 'elastic_transform', 'fog', 'frost', 'gaussian_blur', 'gaussian_noise', 'glass_blur', 'impulse_noise', 'jpeg_compression', 'motion_blur', 'pixelate', 'saturate', 'shot_noise', 'snow', 'spatter', 'speckle_noise', 'zoom_blur']ο
- class detectors.data.imagenet.ImageNetO(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageNetAImageNetO datasets.
Contains unknown classes to ImageNet-1k.
- base_folder = 'imagenet-o'ο
- filename = 'imagenet-o.tar'ο
- tgz_md5 = '86bd7a50c1c4074fb18fc5f219d6d50b'ο
- url = 'https://people.eecs.berkeley.edu/~hendrycks/imagenet-o.tar'ο
- class detectors.data.imagenet.ImageNetR(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageNetAImageNet-R(endition) dataset.
Contains art, cartoons, deviantart, graffiti, embroidery, graphics, origami, paintings, patterns, plastic objects,plush objects, sculptures, sketches, tattoos, toys, and video game renditions of ImageNet-1k classes.
- base_folder = 'imagenet-r'ο
- filename = 'imagenet-r.tar'ο
- tgz_md5 = 'a61312130a589d0ca1a8fca1f2bd3337'ο
- url = 'https://people.eecs.berkeley.edu/~hendrycks/imagenet-r.tar'ο
detectors.data.imagenetlt moduleο
- class detectors.data.imagenetlt.LT_Dataset(root: str, txt_path: str, subset_class_idx=array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999]), transform=None)[source]ο
Bases:
Dataset
detectors.data.isun moduleο
- class detectors.data.isun.iSUN(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderiSUN Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'iSUN'ο
- file_md5 = 'be77b0f2c26fda898afac5f99645ee70'ο
- filename = 'iSUN.tar.gz'ο
- url = 'https://www.dropbox.com/s/ssz7qxfqae0cca5/iSUN.tar.gz'ο
detectors.data.lsun_r_c moduleο
- class detectors.data.lsun_r_c.LSUNCroped(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
LSUNResizedLSUN (c) Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'LSUN_croped'ο
- file_md5 = '458a0a0ab8e5f1cb4516d7400568e460'ο
- filename = 'LSUN.tar.gz'ο
- url = 'https://www.dropbox.com/s/fhtsw1m3qxlwj6h/LSUN.tar.gz'ο
- class detectors.data.lsun_r_c.LSUNResized(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderLSUN (r) Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'LSUN_resized'ο
- file_md5 = '278b7b31c8cb7e804a1465a8ce03a2dc'ο
- filename = 'LSUN_resize.tar.gz'ο
- url = 'https://www.dropbox.com/s/moqh2wh8696c3yl/LSUN_resize.tar.gz'ο
detectors.data.mnist_wrapped moduleο
detectors.data.mnistc moduleο
- class detectors.data.mnistc.MNISTC(root: str, corruption: str, split: str, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
objectMNIST-C is MNIST with corruptions for benchmarking OOD methods.
Split can be one of train, test and leftovers.
- Subsets can be one of:
all, brightness, canny_edges, dotted_line, fog, glass_blur, identity, impulse_noise, motion_blur, rotate, scale, shear, shot_noise, spatter, stripe, translate and zigzag.
- base_folders = ['mnist_c', 'mnist_c_leftovers']ο
- filenames = ['mnist_c.zip', 'mnist_c_leftovers.zip']ο
- splits = ['train', 'test', 'leftovers']ο
- subsets = ['brightness', 'canny_edges', 'dotted_line', 'fog', 'glass_blur', 'identity', 'impulse_noise', 'motion_blur', 'rotate', 'scale', 'shear', 'shot_noise', 'spatter', 'stripe', 'translate', 'zigzag']ο
- tgz_md5s = ['4b34b33045869ee6d424616cd3a65da3', 'c365e9c25addd5c24454b19ac7101070']ο
- urls = ['https://zenodo.org/record/3239543/files/mnist_c.zip', 'https://zenodo.org/record/3239543/files/mnist_c_leftovers.zip']ο
detectors.data.mos moduleο
- class detectors.data.mos.MOSPlaces365(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
MOSSUNMOS Places365 Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'mos_places365'ο
- file_md5 = 'b5cb5eba2754ae2a28beea8718db699a'ο
- filename = 'Places.tar.gz'ο
- url = 'http://pages.cs.wisc.edu/~huangrui/imagenet_ood_dataset/Places.tar.gz'ο
- class detectors.data.mos.MOSSUN(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderMOS SUN Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'mos_sun'ο
- file_md5 = '8469c3ada62211477954ec1be53b12d0'ο
- filename = 'SUN.tar.gz'ο
- url = 'http://pages.cs.wisc.edu/~huangrui/imagenet_ood_dataset/SUN.tar.gz'ο
- class detectors.data.mos.MOSiNaturalist(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
MOSSUNMOS iNaturalist Dataset subset.
- Parameters:
root (string) β Root directory of dataset where directory exists or will be saved to if download is set to True.
split (string, optional) β The dataset split, not used.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop.
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments passed to
ImageFolder.
- base_folder = 'mos_inaturalist'ο
- file_md5 = '5be6ea8aa027d7b631916427b32cb335'ο
- filename = 'iNaturalist.tar.gz'ο
- url = 'http://pages.cs.wisc.edu/~huangrui/imagenet_ood_dataset/iNaturalist.tar.gz'ο
detectors.data.noise moduleο
- class detectors.data.noise.Blobs(root: str | None = None, split: str | None = None, transform: Callable | None = None, download: bool = False, nb_samples=10000, shape: Tuple[int, int, int] = (224, 224, 3), seed=1, **kwargs)[source]ο
Bases:
CustomTensorDataset
- class detectors.data.noise.CustomTensorDataset(*tensors, transform=None)[source]ο
Bases:
DatasetTensorDataset with support for transformations.
- Parameters:
*tensors (Tensor) β tensors that have the same size of the first dimension.
transform (callable, optional) β transform to apply.
- class detectors.data.noise.Gaussian(root: str | None = None, split: str | None = None, transform: Callable | None = None, download: bool = False, nb_samples=10000, shape: Tuple[int, int, int] = (224, 224, 3), seed=1, **kwargs)[source]ο
Bases:
CustomTensorDatasetGaussian noise dataset.
- Parameters:
root (str) β root directory.
split (str, optional) β not used.
transform (callable, optional) β transform to apply.
download (bool, optional) β not used.
nb_samples (int) β number of samples.
shape (tuple[int, int, int]) β shape of the samples.
seed (int) β seed for the random number generator.
- class detectors.data.noise.Rademacher(root: str | None = None, split: str | None = None, transform: Callable | None = None, download: bool = False, nb_samples=10000, shape: Tuple[int, int, int] = (224, 224, 3), seed=1, **kwargs)[source]ο
Bases:
CustomTensorDataset
- class detectors.data.noise.Uniform(root: str | None = None, split: str | None = None, transform: Callable | None = None, download: bool = False, nb_samples=10000, shape: Tuple[int, int, int] = (224, 224, 3), seed=1, **kwargs)[source]ο
Bases:
CustomTensorDatasetUniform noise dataset.
- Parameters:
root (str) β root directory.
split (str, optional) β not used.
transform (callable, optional) β transform to apply.
download (bool, optional) β not used.
nb_samples (int) β number of samples.
shape (tuple[int, int, int]) β shape of the samples.
seed (int) β seed for the random number generator.
detectors.data.openimage_o moduleο
- class detectors.data.openimage_o.OpenImageO(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderOpenImageO dataset.
- Length: <17632
(sore url returns http error code 404. Might need to invoke several times to get at lkeas 16k images). Confirmed 16067 images.
Size: >30GB
Auxiliary file: OpenImageO/openimage_o_urls.csv
Args:
- base_folder = 'openimage-o'ο
- filenames = 'OpenImageO/openimage_o_urls.csv'ο
detectors.data.places365 moduleο
- class detectors.data.places365.Places365(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolder- base_folder = 'places365'ο
- file_md5 = 'e27b17d8d44f4af9a78502beb927f808'ο
- filename = 'val_256.tar'ο
- url = 'http://data.csail.mit.edu/places/places365/val_256.tar'ο
detectors.data.textures moduleο
- class detectors.data.textures.Textures(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolderDTD is a texture database, consisting of 5640 images, organized according to a list of 47 terms (categories) inspired from human perception. There are 120 images for each category. Image sizes range between 300x300 and 640x640, and the images contain at least 90% of the surface representing the category attribute. The images were collected from Google and Flickr by entering our proposed attributes and related terms as search queries.
- base_folder = 'textures'ο
- property dataset_folderο
- file_md5 = 'fff73e5086ae6bdbea199a49dfb8a4c1'ο
- filename = 'dtd-r1.0.1.tar.gz'ο
- images_folder = 'dtd/images'ο
- property split_folderο
- url = 'https://www.robots.ox.ac.uk/~vgg/data/dtd/download/dtd-r1.0.1.tar.gz'ο
detectors.data.tiny_imagenet moduleο
Simple Tiny ImageNet dataset utility class for pytorch.
- class detectors.data.tiny_imagenet.TinyImageNet(root, split='train', transform: Callable | None = None, download=False, **kwargs)[source]ο
Bases:
ImageFolderDataset for TinyImageNet-200
- base_folder = 'tiny-imagenet-200'ο
- property dataset_folderο
- filename = 'tiny-imagenet-200.zip'ο
- property split_folderο
- splits = ('train', 'val', 'test')ο
- url = 'http://cs231n.stanford.edu/tiny-imagenet-200.zip'ο
- zip_md5 = '90528d7ca1a48142e341f4ef8d21d0de'ο
detectors.data.tiny_imagenet_r_c moduleο
- class detectors.data.tiny_imagenet_r_c.TinyImageNetCroped(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
TinyImageNetResized- base_folder = 'Imagenet_croped'ο
- file_md5 = '7c0827e4246c3718a5ee076e999e52e5'ο
- filename = 'Imagenet.tar.gz'ο
- url = 'https://www.dropbox.com/s/avgm2u562itwpkl/Imagenet.tar.gz'ο
- class detectors.data.tiny_imagenet_r_c.TinyImageNetResized(root: str, split=None, transform: Callable | None = None, download: bool = False, **kwargs)[source]ο
Bases:
ImageFolder- base_folder = 'Imagenet_resized'ο
- file_md5 = '0f9ff11d45babf2eff5fe12281d1ac31'ο
- filename = 'Imagenet_resize.tar.gz'ο
- url = 'https://www.dropbox.com/s/kp3my3412u5k9rl/Imagenet_resize.tar.gz'ο
detectors.data.wilds_ds moduleο
Module contentsο
Datasets module.
- class detectors.data.DatasetsRegistry(value)ο
Bases:
EnumAn enumeration.
- blobs = 'blobs'ο
- cifar10 = 'cifar10'ο
- cifar100 = 'cifar100'ο
- cifar100_c = 'cifar100_c'ο
- cifar10_c = 'cifar10_c'ο
- english_chars = 'english_chars'ο
- fashion_mnist = 'fashion_mnist'ο
- gaussian = 'gaussian'ο
- ilsvrc2012 = 'ilsvrc2012'ο
- imagenet = 'imagenet'ο
- imagenet1k = 'imagenet1k'ο
- imagenet1k_c = 'imagenet1k_c'ο
- imagenet_a = 'imagenet_a'ο
- imagenet_c = 'imagenet_c'ο
- imagenet_c_npz = 'imagenet_c_npz'ο
- imagenet_o = 'imagenet_o'ο
- imagenet_r = 'imagenet_r'ο
- isun = 'isun'ο
- lsun_c = 'lsun_c'ο
- lsun_r = 'lsun_r'ο
- mnist = 'mnist'ο
- mnist_c = 'mnist_c'ο
- mos_inaturalist = 'mos_inaturalist'ο
- mos_places365 = 'mos_places365'ο
- mos_sun = 'mos_sun'ο
- openimage_o = 'openimage_o'ο
- oxford_pets = 'oxford_pets'ο
- places365 = 'places365'ο
- rademacher = 'rademacher'ο
- stanford_cars = 'stanford_cars'ο
- stl10 = 'stl10'ο
- svhn = 'svhn'ο
- textures = 'textures'ο
- tiny_imagenet = 'tiny_imagenet'ο
- tiny_imagenet_c = 'tiny_imagenet_c'ο
- tiny_imagenet_r = 'tiny_imagenet_r'ο
- uniform = 'uniform'ο
- wilds_camelyon17 = 'wilds_camelyon17'ο
- wilds_fmow = 'wilds_fmow'ο
- wilds_globalwheat = 'wilds_globalwheat'ο
- wilds_iwildcam = 'wilds_iwildcam'ο
- wilds_poverty = 'wilds_poverty'ο
- wilds_rxrx1 = 'wilds_rxrx1'ο
- detectors.data.create_dataset(dataset_name: str, root: str = '/home/docs/checkouts/readthedocs.org/user_builds/detectors/checkouts/latest/data/', split: str | None = 'train', transform: Callable | None = None, download: bool | None = True, **kwargs)[source]ο
Create dataset factory.
- Parameters:
dataset_name (string) β
Name of the dataset. Already implemented:
cifar10, cifar100, stl10, svhn, mnist, fashion_mnist, kmnist, emnist, mnist_c, english_chars, isun, lsun_c, lsun_r, tiny_imagenet_c, tiny_imagenet_r, tiny_imagenet, textures, gaussian, uniform, places365, stanford_cars, imagenet, imagenet1k, ilsvrc2012, mos_inaturalist, mos_places365, mos_sun, cifar10_lt, cifar100_lt, imagenet1k_lt, cifar10_c, cifar100_c, imagenet_c, imagenet_c_npz, imagenet_a, imagenet_r, imagenet_o, openimage_o, oxford_pets, oxford_flowers, cub200, imagenet1k_c, blobs, rademacher, wilds_iwildcam, wilds_fmow, wilds_camelyon17, wilds_rxrx1, wilds_poverty, wilds_globalwheat.
root (string) β Root directory of dataset.
split (string, optional) β Depends on the selected dataset.
transform (callable, optional) β A function/transform that takes in an PIL image and returns a transformed version. E.g, transforms.RandomCrop
download (bool, optional) β If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
**kwargs β Additional arguments for dataset.
- Raises:
ValueError β If dataset name is not specified.
- Returns:
Dataset object.
- Return type:
Dataset
- detectors.data.get_dataset_cls(dataset_name: str) Type[Dataset][source]ο
Return dataset class by name.
- Parameters:
dataset_name (string) β Name of the dataset.
- Raises:
ValueError β If dataset name is not available in datasets_registry.
- Returns:
Dataset class.
- Return type:
Dataset