python_code stringlengths 0 4.04M | repo_name stringlengths 8 58 | file_path stringlengths 5 147 |
|---|---|---|
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from classy_vision import meters
from classy_vision.meters import AccuracyMeter
from test.generic.meter_... | ClassyVision-main | test/meters_accuracy_meter_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
from functools import partial
import torch
from classy_vision.generic.util import get_torch_version
from... | ClassyVision-main | test/heads_fully_connected_head_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.optim.param_scheduler import LinearParamScheduler
from classy_vision... | ClassyVision-main | test/optim_sgd_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import itertools
import shutil
import tempfile
import unittest
import torch
import torch.nn as nn
from c... | ClassyVision-main | test/tasks_classification_task_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
StepPar... | ClassyVision-main | test/optim_param_scheduler_step_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
import torchvision.transforms._transforms_video as transforms_video
from cl... | ClassyVision-main | test/dataset_transforms_util_video_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
MultiSt... | ClassyVision-main | test/optim_param_scheduler_multi_step_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import logging
import unittest
import torch
import torch.nn as nn
from classy_vision.generic.util import... | ClassyVision-main | test/models_regnet_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.dataset import build_dataset, register_dataset
from classy_vision.da... | ClassyVision-main | test/dataset_classy_video_dataset_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import csv
import os
import shutil
import tempfile
import torch
from classy_vision.hooks import OutputCSVHook
from c... | ClassyVision-main | test/hooks_output_csv_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
Polynom... | ClassyVision-main | test/optim_param_scheduler_polynomial_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.losses import (
build_loss,
ClassyLoss,
MultiOutputSumLo... | ClassyVision-main | test/losses_multi_output_sum_loss_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from typing import Any, Dict
from unittest import mock
import torch
import torch.nn as n... | ClassyVision-main | test/tasks_fine_tuning_task_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| ClassyVision-main | test/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
import torch.nn as nn
from classy_vision.generic.profiler import (
compute_activati... | ClassyVision-main | test/generic_profiler_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
LinearP... | ClassyVision-main | test/optim_param_scheduler_linear_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.heads.vision_transformer_head import VisionTransformerHead
class T... | ClassyVision-main | test/heads_vision_transformer_head_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing as mp
import unittest
import unittest.mock as mock
import classy_vision.dataset.classy_datase... | ClassyVision-main | test/dataset_classy_dataset_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.generic.util import get_torch_version
from classy_vision.models impo... | ClassyVision-main | test/models_densenet_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import classy_vision.heads.fully_convolutional_linear_head as fcl
import torch
class TestFullyConv... | ClassyVision-main | test/heads_fully_convolutional_linear_head_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.optim.rmsprop import RMSProp
from test.generic.optim_test_util import TestOptimiz... | ClassyVision-main | test/optim_rmsprop_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
import torch.nn as nn
from classy_vision.heads import ClassyHead
from classy_vision.mod... | ClassyVision-main | test/models_classy_block_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import numpy as np
import torch
import torchvision.transforms as transforms
from classy_vision.datas... | ClassyVision-main | test/dataloader_async_gpu_wrapper_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Various test loaders."""
import os
import random
import unittest
from itertools import chain
def _circleci_para... | ClassyVision-main | test/suites.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
StepWit... | ClassyVision-main | test/optim_param_scheduler_step_with_fixed_gamma_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import shutil
import tempfile
import unittest
import torch
from classy_vision.dataset import build_dataset... | ClassyVision-main | test/dataset_image_path_dataset_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
from classy_vision.models import build_model, ClassyModel
from test.generic... | ClassyVision-main | test/models_resnext3d_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import logging
import... | ClassyVision-main | test/optim_sharded_sgd_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
import torchvision.transforms as transforms
from classy_vision.dataset.transforms impor... | ClassyVision-main | test/dataset_transforms_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
CosineP... | ClassyVision-main | test/optim_param_scheduler_cosine_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.dataset.core.random_image_datasets import (
RandomImageBinaryClassDataset,
)
... | ClassyVision-main | test/dataset_transforms_autoaugment_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import shutil
import tempfile
import unittest
import unittest.mock as mock
from pathlib import Path
impo... | ClassyVision-main | test/generic_util_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.optim.adam import Adam
from test.generic.optim_test_util import TestOptimizer
c... | ClassyVision-main | test/optim_adam_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import collections
import unittest
import torch
import torchvision.models
from classy_vision.generic.util import get... | ClassyVision-main | test/models_resnext_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.dataset.core.random_image_datasets import (
RandomImageBinaryClassDataset,
)
... | ClassyVision-main | test/dataset_transforms_lighting_transform_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import unittest.mock as mock
from itertools import product
from classy_vision.hooks impo... | ClassyVision-main | test/hooks_loss_lr_meter_logging_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import random
import unittest
import numpy
import torch
import torchvision.transforms as transforms
from... | ClassyVision-main | test/dataset_transforms_util_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.heads import build_head, ClassyHead, register_head
class TestClass... | ClassyVision-main | test/classy_vision_head_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.generic.util import get_torch_version
from classy_vision.models impo... | ClassyVision-main | test/models_mlp_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import importlib
import os
import shutil
import tempfile
import torch
from classy_vision.generic.util im... | ClassyVision-main | test/hooks_checkpoint_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.dataset import build_dataset
from classy_vision.hooks import LossLrMeterLoggingHo... | ClassyVision-main | test/trainer_local_trainer_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
from classy_vision.losses import build_loss, SoftTargetCrossEntropyLoss
c... | ClassyVision-main | test/losses_soft_target_cross_entropy_loss_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.generic.util import get_torch_version
from classy_vision.losses impo... | ClassyVision-main | test/losses_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import pathlib
import sys
import ... | ClassyVision-main | test/api_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
from classy_vision.models import build_model
from test.generic.utils import... | ClassyVision-main | test/models_vision_transformer_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.tasks import build_task
from test.generic.config_utils import get_test_task_confi... | ClassyVision-main | test/dataset_dataloader_limit_wrapper_test.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from test.generic.utils import ClassyTestCase
class TestClassyTestCase(unittest.TestCase):
def test_asse... | ClassyVision-main | test/test_generic_utils_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import math
import unittest
import unittest.mock as mock
import torch
import torch.nn as nn
from classy_... | ClassyVision-main | test/hooks_exponential_moving_average_model_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from classy_vision import meters
from classy_vision.meters import PrecisionAtKMeter
from test.generic.me... | ClassyVision-main | test/meters_precision_meter_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
Constan... | ClassyVision-main | test/optim_param_scheduler_constant_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import shutil
import tempfile
import unittest
import torch
from classy_vision.dataset.transforms import ClassyTransf... | ClassyVision-main | test/hub_classy_hub_interface_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import os
import shutil
import tempfile
import torch
from classy_vision.hooks import TorchscriptHook
fro... | ClassyVision-main | test/hooks_torchscript_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import os
import shutil
import tempfile
import unittest
import torch
import torch.nn as nn
from classy_v... | ClassyVision-main | test/models_classy_model_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import json
import os
import subprocess
import tempfile
import unittest
from pathlib import Path
import ... | ClassyVision-main | test/trainer_distributed_trainer_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from classy_vision.dataset.transforms.mixup import MixupTransform
class DatasetTrans... | ClassyVision-main | test/dataset_transforms_mixup_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
from classy_vision.losses import build_loss, ClassyLoss, register_loss, Sum... | ClassyVision-main | test/losses_sum_arbitrary_loss_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from collections import defaultdict
import torch
from classy_vision.heads import build_h... | ClassyVision-main | test/manual/models_classy_vision_model_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.optim.adamw_mt import AdamWMT
from test.generic.optim_test_util import TestOptimi... | ClassyVision-main | test/manual/optim_adamw_mt_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import unittest.mock as mock
import progressbar
from classy_vision.hooks import ProgressBarHook
from... | ClassyVision-main | test/manual/hooks_progress_bar_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import torch
from classy_vision.tasks import build_task, ClassificationTask
from classy_... | ClassyVision-main | test/manual/tasks_classification_task_amp_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.hooks import ModelComplexityHook
from classy_vision.models import build_model
fro... | ClassyVision-main | test/manual/hooks_model_complexity_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.optim.adamw import AdamW
from test.generic.optim_test_util import TestOptimizer
... | ClassyVision-main | test/manual/optim_adamw_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
import unittest.mock as mock
from itertools import product
from classy_vision.hooks impo... | ClassyVision-main | test/manual/hooks_visdom_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import shutil
import tempfile
import unittest.mock as mock
from itertools import product
from classy_vis... | ClassyVision-main | test/manual/hooks_tensorboard_plot_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import unittest.mock as mock
from classy_vision.hooks import ModelTensorboardHook
from classy_vision... | ClassyVision-main | test/manual/hooks_model_tensorboard_hook_test.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| ClassyVision-main | test/generic/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from classy_vision.hooks import build_hook
class HookTestBase(unittest.TestCase):
def construc... | ClassyVision-main | test/generic/hook_test_utils.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing
import queue
import tempfile
import unittest
import torch
UPDATE_SIGNAL = 0
VALUE_SIGNAL = ... | ClassyVision-main | test/generic/meter_test_utils.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class MergeDataset:
"""
Dataset that merges samples from multiple datasets into single sample.
If datas... | ClassyVision-main | test/generic/merge_dataset.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import unittest
from functools import wraps
import torch
from classy_vision.hooks import ClassyHook
from c... | ClassyVision-main | test/generic/utils.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import ABC, abstractmethod
from unittest.mock import MagicMock
import torch
import torch.nn as nn
from clas... | ClassyVision-main | test/generic/optim_test_util.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
from classy_vision.tasks import build_task
def get_test_task_config(head_num_classes=1000):
return ... | ClassyVision-main | test/generic/config_utils.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| ClassyVision-main | hydra_plugins/classy_vision_path/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from hydra.core.config_search_path import ConfigSearchPath
from hydra.plugins.search_path_plugin import SearchPathPlu... | ClassyVision-main | hydra_plugins/classy_vision_path/classy_vision_path.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common... | ClassyVision-main | sphinx/conf.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import os
import nbformat
from bs4 import BeautifulSoup
from nbconvert import HTMLExport... | ClassyVision-main | scripts/parse_tutorials.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
from bs4 import BeautifulSoup
js_scripts = """
<script type="text/javascript" id="docume... | ClassyVision-main | scripts/parse_sphinx.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__version__ = "0.7.0"
| ClassyVision-main | classy_vision/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict, List, Optional
import torch
from torch import Tensor
from . import build_loss, Classy... | ClassyVision-main | classy_vision/losses/sum_arbitrary_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import traceback
from pathlib import Path
import torch
import torch.nn.modules.loss as torch_losses
from... | ClassyVision-main | classy_vision/losses/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import torch
from . import build_loss, ClassyLoss, register_loss
@register_loss("mul... | ClassyVision-main | classy_vision/losses/multi_output_sum_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import torch.nn as nn
class ClassyLoss(nn.Module):
"""
Base class to calculat... | ClassyVision-main | classy_vision/losses/classy_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import torch
from . import ClassyLoss, register_loss
@register_loss("barron")
class ... | ClassyVision-main | classy_vision/losses/barron_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import torch
import torch.nn.functional as F
from classy_vision.generic.util import co... | ClassyVision-main | classy_vision/losses/soft_target_cross_entropy_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import numpy as np
from classy_vision.generic.util import convert_to_one_hot
from class... | ClassyVision-main | classy_vision/losses/label_smoothing_loss.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
from classy_vision.generic.util import (
load_and_broadcast_checkpoint,
update_... | ClassyVision-main | classy_vision/tasks/fine_tuning_task.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import ABC, abstractmethod
from typing import Any, Dict
from classy_vision.generic.util import log_class_u... | ClassyVision-main | classy_vision/tasks/classy_task.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import traceback
from pathlib import Path
from classy_vision.generic.registry_utils import import_all_modules
from ... | ClassyVision-main | classy_vision/tasks/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import copy
import enum
import json
import logging
import math
import multiprocessing as mp
import ... | ClassyVision-main | classy_vision/tasks/classification_task.py |
#!/usr/bin/env python3 -u
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import socket
import subprocess
import sys
import time
from argparse import ArgumentPars... | ClassyVision-main | classy_vision/distributed/launch_ray.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| ClassyVision-main | classy_vision/distributed/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from typing import Any, Callable, Dict, Optional
import torch
from torchvision.datasets.hmdb51 import HMDB... | ClassyVision-main | classy_vision/dataset/classy_hmdb51.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import ABC, abstractmethod
from typing import Any, Iterable, Iterator
class DataloaderWrapper(ABC):
""... | ClassyVision-main | classy_vision/dataset/dataloader_wrapper.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Callable, Dict, Optional, Union
from classy_vision.dataset import ClassyDataset, register_da... | ClassyVision-main | classy_vision/dataset/classy_cifar.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os.path
from typing import Any, Callable, Dict, List, Optional, Union
from torchvision import datasets, trans... | ClassyVision-main | classy_vision/dataset/image_path_dataset.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from typing import Any, Callable, Dict, List, Optional
import torch
from torchvision.datasets.kinetics imp... | ClassyVision-main | classy_vision/dataset/classy_kinetics400.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Callable, Dict
from classy_vision.generic.distributed_util import get_rank, get_world_size
... | ClassyVision-main | classy_vision/dataset/classy_synthetic_video.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import traceback
from pathlib import Path
from classy_vision.generic.registry_utils import import_all_modules
from ... | ClassyVision-main | classy_vision/dataset/__init__.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torchvision.transforms as transforms
from classy_vision.dataset import register_dataset
from classy_vision.da... | ClassyVision-main | classy_vision/dataset/classy_synthetic_image_streaming.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from typing import Any, Callable, Dict, List, Optional
import torchvision.transforms as transforms
f... | ClassyVision-main | classy_vision/dataset/classy_synthetic_image.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.