python_code
stringlengths
0
4.04M
repo_name
stringlengths
7
58
file_path
stringlengths
5
147
"""Unittests for Datasets.""" from itertools import product import numpy as np import pytest from meerkat import concat from meerkat.columns.object.base import ObjectColumn from meerkat.columns.tensor.numpy import NumPyTensorColumn from meerkat.dataframe import DataFrame from meerkat.errors import ConcatError, Concat...
meerkat-main
tests/meerkat/ops/test_concat.py
import pytest from meerkat import DeferredColumn from meerkat.dataframe import DataFrame from ...utils import product_parametrize from ..columns.abstract import AbstractColumnTestBed, column_parametrize # from ..columns.deferred.test_deferred import DeferredColumnTestBed # from ..columns.deferred.test_image import I...
meerkat-main
tests/meerkat/ops/test_map.py
import hashlib import os import numpy as np import PIL import pytest import torch from PIL import Image import meerkat as mk from meerkat import embed from meerkat.ops.embed import encoders from meerkat.ops.embed.encoder import Encoder class ImageColumnTestBed: def __init__( self, tmpdir: str, ...
meerkat-main
tests/meerkat/ops/embed/test__init__.py
meerkat-main
tests/meerkat/ops/embed/__init__.py
meerkat-main
tests/meerkat/ops/sliceby/__init __.py
import numpy as np from meerkat import NumPyTensorColumn, ObjectColumn from meerkat.dataframe import DataFrame from meerkat.ops.sliceby.groupby import GroupBy, groupby # Comment for meeting 5/19: Testing group by multiple columns, # single columns on list, on string. # Different columns as by: including ListColumn, ...
meerkat-main
tests/meerkat/ops/sliceby/test_groupby.py
from functools import wraps from itertools import product from typing import Any, Dict, List, Type, Union import numpy as np import pytest def column_parametrize( testbed_classes: List[Union[Type, Dict]], config: dict = None, single: bool = False, ): params = [ c.get_params(config=config, sin...
meerkat-main
tests/meerkat/columns/abstract.py
import os import numpy as np import pandas as pd import pytest from meerkat import DeferredColumn, NumPyTensorColumn, TorchTensorColumn from meerkat.columns.deferred.base import DeferredCell from meerkat.columns.scalar.pandas import PandasScalarColumn from meerkat.errors import ConversionError, ImmutableError from ....
meerkat-main
tests/meerkat/columns/test_common.py
meerkat-main
tests/meerkat/columns/__init__.py
"""Unittests for NumpyColumn.""" from __future__ import annotations import os from typing import List, Union import numpy as np import pytest import torch import torchaudio from meerkat import AudioColumn from meerkat.columns.abstract import Column from meerkat.columns.deferred.base import DeferredCell from meerkat....
meerkat-main
tests/meerkat/columns/deferred/test_audio.py
"""Unittests for NumpyColumn.""" from __future__ import annotations import os from typing import List, Union import numpy as np import pandas as pd import pytest import torch import torchvision.datasets.folder as folder from PIL import Image import meerkat from meerkat import ImageColumn from meerkat.block.deferred_...
meerkat-main
tests/meerkat/columns/deferred/test_image.py
meerkat-main
tests/meerkat/columns/deferred/__init__.py
import json import os from typing import Union import dill import numpy as np import pytest from PIL import Image import meerkat as mk from meerkat.block.deferred_block import DeferredCellOp, DeferredOp from meerkat.columns.deferred.base import DeferredCell from meerkat.columns.deferred.file import FILE_TYPES, FileCe...
meerkat-main
tests/meerkat/columns/deferred/test_file_column.py
import json import os from typing import Union import dill import numpy as np import pytest from PIL import Image from meerkat.block.deferred_block import DeferredCellOp, DeferredOp from meerkat.columns.deferred.base import DeferredCell from meerkat.columns.deferred.file import FileCell, FileColumn, FileLoader from m...
meerkat-main
tests/meerkat/columns/deferred/test_file.py
"""Unittests for LambdaColumn.""" from typing import Type import numpy as np import pytest import meerkat as mk from meerkat import DeferredColumn, NumPyTensorColumn, ObjectColumn from meerkat.errors import ConcatWarning from ....testbeds import MockColumn, MockDatapanel from ..abstract import AbstractColumnTestBed,...
meerkat-main
tests/meerkat/columns/deferred/test_deferred.py
meerkat-main
tests/meerkat/columns/object/__init__.py
import time import numpy as np from PIL import Image from meerkat.columns.object.base import ObjectColumn from meerkat.interactive.formatter.image import ImageFormatterGroup def test_formatters_image(): """Test formatters when the object column is full of images.""" images = [ Image.fromarray(np.ran...
meerkat-main
tests/meerkat/columns/object/test_base.py
import numpy as np import pandas as pd import pytest import torch from meerkat import TensorColumn, TorchTensorColumn from meerkat.block.numpy_block import NumPyBlock from ..abstract import AbstractColumnTestBed, column_parametrize class TensorColumnTestBed(AbstractColumnTestBed): DEFAULT_CONFIG = { "nu...
meerkat-main
tests/meerkat/columns/tensor/test_tensor_column.py
import numpy as np import pandas as pd import pytest import torch from meerkat import NumPyTensorColumn, TorchTensorColumn from meerkat.block.torch_block import TorchBlock from ..abstract import AbstractColumnTestBed, column_parametrize class TorchTensorColumnTestBed(AbstractColumnTestBed): DEFAULT_CONFIG = { ...
meerkat-main
tests/meerkat/columns/tensor/test_torch.py
meerkat-main
tests/meerkat/columns/tensor/__init__.py
import os import numpy as np import numpy.testing as np_test import pandas as pd import pytest from numpy.lib.format import open_memmap from meerkat import NumPyTensorColumn, TorchTensorColumn from meerkat.block.numpy_block import NumPyBlock from ....utils import product_parametrize from ..abstract import AbstractCo...
meerkat-main
tests/meerkat/columns/tensor/test_numpy.py
meerkat-main
tests/meerkat/columns/scalar/__init__.py
import itertools from typing import Dict import numpy as np import pandas as pd import pyarrow as pa import pytest import torch from meerkat import ScalarColumn from meerkat.dataframe import DataFrame from tests.utils import product_parametrize BACKENDS = ["arrow", "pandas"] @pytest.mark.parametrize( "data", ...
meerkat-main
tests/meerkat/columns/scalar/test_scalar_column.py
"""Unittests for NumpyColumn.""" import numpy as np import pandas as pd import pytest import torch from meerkat import ScalarColumn from meerkat.block.torch_block import TorchBlock from ..abstract import AbstractColumnTestBed, column_parametrize class PandasScalarColumnTestBed(AbstractColumnTestBed): DEFAULT_...
meerkat-main
tests/meerkat/columns/scalar/test_pandas.py
"""Unittests for NumpyColumn.""" from typing import Union import numpy as np import pandas as pd import pyarrow as pa import pytest import torch from meerkat import ArrowScalarColumn from meerkat.block.torch_block import TorchBlock from ..abstract import AbstractColumnTestBed, column_parametrize def to_numpy(array...
meerkat-main
tests/meerkat/columns/scalar/test_arrow.py
import glob import os import tempfile from pathlib import Path import pytest from meerkat import initialize_logging def test_initialize_logging(): initialize_logging() @pytest.fixture def unreadable_dir(tmpdir): unread_dir = tmpdir / "unreadable" os.makedirs(unread_dir) unread_dir.chmod(0) if ...
meerkat-main
tests/meerkat/logging/test_utils.py
import pytest import torch from meerkat import TorchTensorColumn from meerkat.block.abstract import BlockView from meerkat.block.ref import BlockRef from meerkat.block.torch_block import TorchBlock from meerkat.errors import ConsolidationError def test_signature_hash(): # check equal block1 = TorchBlock(torc...
meerkat-main
tests/meerkat/block/test_tensor_block.py
import numpy as np import pyarrow as pa import pytest from meerkat.block.abstract import BlockView from meerkat.block.arrow_block import ArrowBlock from meerkat.block.ref import BlockRef from meerkat.columns.scalar.arrow import ArrowScalarColumn from meerkat.errors import ConsolidationError def test_signature_hash()...
meerkat-main
tests/meerkat/block/test_arrow_block.py
import numpy as np import pytest from meerkat import NumPyTensorColumn from meerkat.block.abstract import BlockView from meerkat.block.numpy_block import NumPyBlock from meerkat.block.ref import BlockRef from meerkat.errors import ConsolidationError def test_signature_hash(): # check equal block1 = NumPyBloc...
meerkat-main
tests/meerkat/block/test_numpy_block.py
meerkat-main
tests/meerkat/block/__init__.py
import numpy as np import pandas as pd import pytest from meerkat import ScalarColumn from meerkat.block.abstract import BlockView from meerkat.block.pandas_block import PandasBlock from meerkat.block.ref import BlockRef from meerkat.errors import ConsolidationError def test_signature_hash(): # check equal b...
meerkat-main
tests/meerkat/block/test_pandas_block.py
import numpy as np from meerkat import DeferredColumn, TensorColumn from meerkat.block.deferred_block import DeferredBlock, DeferredOp from meerkat.block.ref import BlockRef from ...utils import product_parametrize def fn(x: int) -> int: return x + 1, x + 2, x + 3 @product_parametrize(params={"num_blocks": [1...
meerkat-main
tests/meerkat/block/test_deferred_block.py
import os from itertools import product import numpy as np import pytest import torch import meerkat as mk from meerkat.block.manager import BlockManager from meerkat.tools.utils import load_yaml from ...utils import product_parametrize def test_consolidate_no_op(): mgr = BlockManager() col1 = mk.TensorCol...
meerkat-main
tests/meerkat/block/test_manager.py
"""Functions to generate certain RST files.""" # import math import inspect import os import pathlib from collections import defaultdict from typing import List, Union # import numpy as np import pandas as pd import meerkat as mk _DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) def _replace_contents...
meerkat-main
docs/source/rst_gen.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
meerkat-main
docs/source/conf.py
import os import meerkat as mk def display_df(df: mk.DataFrame, name: str): # need to get absolute paths so this works on readthedocs base_dir = os.path.join(os.path.dirname(os.path.dirname(mk.__file__)), "docs") body_html = df._repr_html_() css = open(os.path.join(base_dir, "source/html/display/data...
meerkat-main
docs/source/display.py
from typing import List import meerkat as mk def get_rst_class_ref(klass: type): return f":class:`dcbench.{klass.__name__}`" def get_link(text: str, url: str): return f"`{text} <{url}>`_" def create_tags_html(tags: List[str]): tags = "".join([f"<div class='tag'>{tag.replace('_', ' ')}</div>" for tag ...
meerkat-main
docs/source/datasets/build_datasets_docs.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Evaluation script for object localization import json import argparse import torch import itertools import numpy as np...
ActivityNet-Entities-main
scripts/eval_grd_anet_entities.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Script to print stats on the NP annotation file import numpy as np import json import csv import sys src_file = sys.a...
ActivityNet-Entities-main
scripts/anet_entities_np_stats.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Based on # https://github.com/jiasenlu/NeuralBabyTalk/blob/master/misc/bbox_transform.py # Licensed under The MIT Licen...
ActivityNet-Entities-main
scripts/utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Script to preprocess the raw annotation output to NP/object annotation files import os import sys import json import a...
ActivityNet-Entities-main
scripts/attr_prep_tag_NP.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Script to print stats on the object annotation file import numpy as np import json import csv # import visdom import s...
ActivityNet-Entities-main
scripts/anet_entities_object_stats.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os class Path(object): """ User-specific path configuration. Please complete the /path/to/* paths to ...
astmt-master
mypath.py
astmt-master
experiments/__init__.py
astmt-master
experiments/classification/__init__.py
astmt-master
experiments/classification/imagenet/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os import copy import shutil import time import torch import torch.nn as nn import torch.nn.parall...
astmt-master
experiments/classification/imagenet/train.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch from torchvision import transforms from torch.utils.data import DataLoader from fblib.util.helpers import wo...
astmt-master
experiments/dense_predict/common_configs.py
MAX_N_IMAGES_PER_GPU = { 'res26-8': 8, 'res26-16': 12, 'res50-8': 8, 'res50-16': 10, 'res101-8': 4, 'res101-16': 10, 'x50-8': 4, 'x50-16': 10, 'x101-8': 2, 'x101-16': 6, }
astmt-master
experiments/dense_predict/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import cv2 import argparse import torch import tarfile from six.moves import urllib from easydict imp...
astmt-master
experiments/dense_predict/pascal_resnet/config.py
MAX_N_IMAGES_PER_GPU = { 'se_res26-8': 10, 'se_res26-16': 16, 'se_res50-8': 8, 'se_res50-16': 10, 'se_res101-8': 2, 'se_res101-16': 8, }
astmt-master
experiments/dense_predict/pascal_resnet/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import socket import timeit import cv2 from datetime import datetime import imageio import numpy as np # PyTorc...
astmt-master
experiments/dense_predict/pascal_resnet/main.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import cv2 import argparse import torch import tarfile from six.moves import urllib from easydict imp...
astmt-master
experiments/dense_predict/pascal_mnet/config.py
MAX_N_IMAGES_PER_GPU = { 'mnetv2-8': 10, 'mnetv2-16': 16, }
astmt-master
experiments/dense_predict/pascal_mnet/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import socket import timeit import cv2 from datetime import datetime import imageio import numpy as np # PyTorc...
astmt-master
experiments/dense_predict/pascal_mnet/main.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import cv2 import argparse import torch import tarfile from six.moves import urllib from easydict imp...
astmt-master
experiments/dense_predict/nyud_resnet/config.py
MAX_N_IMAGES_PER_GPU = { 'se_res26-8': 10, 'se_res26-16': 16, 'se_res50-8': 8, 'se_res50-16': 16, 'se_res101-8': 2, 'se_res101-16': 10, }
astmt-master
experiments/dense_predict/nyud_resnet/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import socket import timeit import cv2 from datetime import datetime import imageio import scipy.io as sio impor...
astmt-master
experiments/dense_predict/nyud_resnet/main.py
import os PROJECT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
astmt-master
fblib/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import torch.nn as nn import torch.nn.functional as F class AttentionModuleFree(nn.Module): """ Att...
astmt-master
fblib/layers/attention.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch.nn as nn import torch.nn.functional as F class Normalize(object): """Given mean: (R, G, B) and std: (R,...
astmt-master
fblib/layers/image_features.py
astmt-master
fblib/layers/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from torch.autograd import Function class ReverseLayerF(Function): @staticmethod def forward(ctx, x, alpha): ...
astmt-master
fblib/layers/reverse_grad.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module import numpy...
astmt-master
fblib/layers/loss.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import numpy as np import torch from torch.nn import functional as F def logit(x): return np.log(x/(1-x+1e-08)+1e-08...
astmt-master
fblib/layers/misc_layers.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from torch import nn from fblib.util.custom_container import SequentialMultiTask class SELayer(nn.Module): """ S...
astmt-master
fblib/layers/squeeze.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch from torch.autograd import Variable from torchvision import models from graphviz import Digraph def make_do...
astmt-master
fblib/util/pdf_visualizer.py
astmt-master
fblib/util/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import collections import re from torch._six import string_classes, int_classes _use_shared_memory = False r...
astmt-master
fblib/util/custom_collate.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import cv2 import numpy as np # set random seed in each worker worker_seed = lambda x: np.random.seed((torch...
astmt-master
fblib/util/helpers.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from collections import OrderedDict from torch.nn.modules.container import Sequential class SequentialMultiTask(Sequenti...
astmt-master
fblib/util/custom_container.py
astmt-master
fblib/util/classification/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import time import random class AverageMeter(object): """Computes and stores the average and current value""" d...
astmt-master
fblib/util/classification/utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch from torchvision import utils as vutils import fblib.util.pdf_visualizer as viz from fblib.util.mypath impor...
astmt-master
fblib/util/mtl_tools/multitask_visualizer.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def imagenet_categ_names(): return { 0: 'tench, Tinca tinca', 1: 'goldfish, Carassius auratus', ...
astmt-master
fblib/util/db_info/imagenet_categ.py
astmt-master
fblib/util/db_info/__init__.py
astmt-master
fblib/util/model_resources/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch # ---- Public functions def compute_gflops(net, in_shape=(1, 3, 224, 224), tasks=None): net = add_flop...
astmt-master
fblib/util/model_resources/flops.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def count_parameters(model): return sum(p.numel() for p in model.parameters() if p.requires_grad)
astmt-master
fblib/util/model_resources/num_parameters.py
astmt-master
fblib/util/dense_predict/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def lr_poly(base_lr, iter_, max_iter=100, power=0.9): return base_lr * ((1 - float(iter_) / max_iter) ** power) cl...
astmt-master
fblib/util/dense_predict/utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import torch.nn as nn def traverse_graph(var): """ Args: var: output Variable """ ...
astmt-master
fblib/util/optimizer_mtl/select_used_modules.py
astmt-master
fblib/util/optimizer_mtl/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os from fblib.util.mypath import Path import numpy as np import torch.utils.data as data import cv2 class FSVGTA...
astmt-master
fblib/dataloaders/fsv.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import os.path from pycocotools.coco import COCO import torch.utils.data as data from PIL import Image import n...
astmt-master
fblib/dataloaders/coco.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch.utils.data as data class CombineIMDBs(data.Dataset): """ Combine two datasets, for example to creat...
astmt-master
fblib/dataloaders/combine_im_dbs.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import tarfile import cv2 import numpy as np import torch.utils.data as data from six.moves import u...
astmt-master
fblib/dataloaders/msra10k.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import tarfile import json import cv2 import numpy as np import scipy.io as sio import torch.utils.d...
astmt-master
fblib/dataloaders/pascal_context.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import tarfile import cv2 from PIL import Image import numpy as np import torch.utils.data as data i...
astmt-master
fblib/dataloaders/nyud.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import numpy.random as random import numpy as np import torch import cv2 import math import fblib.util.helpers as helpers ...
astmt-master
fblib/dataloaders/custom_transforms.py
from .bsds import BSDS500 from .coco import COCOSegmentation from .fsv import FSVGTA from .nyud import NYUD_MT, NYUDRaw from .pascal_context import PASCALContext from .pascal_voc import VOC12 from .sbd import SBD from .msra10k import MSRA from .pascal_sal import PASCALS __all__ = ['BSDS500', 'COCOSegmentation', 'FSVGT...
astmt-master
fblib/dataloaders/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import errno import cv2 import hashlib import tarfile import numpy as np import scipy.io as sio impo...
astmt-master
fblib/dataloaders/sbd.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from __future__ import print_function import torch.utils.data as data from PIL import Image import os import os.path impor...
astmt-master
fblib/dataloaders/mnist_multitask.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import tarfile from PIL import Image import numpy as np from glob import glob import scipy.io as sio...
astmt-master
fblib/dataloaders/bsds.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import errno import cv2 import hashlib import tarfile import numpy as np import torch.utils.data as ...
astmt-master
fblib/dataloaders/pascal_voc.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import sys import tarfile import cv2 from PIL import Image import numpy as np import torch.utils.data as data f...
astmt-master
fblib/dataloaders/pascal_sal.py
astmt-master
fblib/networks/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import math import torch import torch.nn as nn from fblib.util.mypath import Path try: from torch.hub imp...
astmt-master
fblib/networks/classification/mobilenet_v2.py
astmt-master
fblib/networks/classification/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import math from collections import OrderedDict import torch import torch.nn as nn from fblib.util.mypath imp...
astmt-master
fblib/networks/classification/se_mobilenet_v2.py