repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
gluon-cv
gluon-cv-master/scripts/detection/faster_rcnn/train_doublehead_rcnn.py
"""Train Doublehead-RCNN end to end.""" import argparse import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round' os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '26' os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999' os.environ['MXN...
34,244
50.26497
108
py
gluon-cv
gluon-cv-master/scripts/detection/faster_rcnn/train_faster_rcnn.py
"""Train Faster-RCNN end to end.""" import argparse import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round' os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '26' os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999' os.environ['MXNET_E...
34,218
50.149477
108
py
gluon-cv
gluon-cv-master/scripts/detection/faster_rcnn/demo_faster_rcnn.py
"""Faster RCNN Demo script.""" import os import argparse import mxnet as mx import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv.data.transforms import presets from matplotlib import pyplot as plt def parse_args(): parser = argparse.ArgumentParser(description='Test with Faster RCNN networks.') p...
2,408
42.8
115
py
gluon-cv
gluon-cv-master/scripts/detection/yolo/train_yolo.py
"""Train YOLOv3 with random shapes.""" import argparse import os import logging import time import warnings import numpy as np import mxnet as mx from mxnet import nd from mxnet import gluon from mxnet import autograd import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import data as gdata from gluoncv ...
18,568
48.517333
149
py
gluon-cv
gluon-cv-master/scripts/detection/yolo/train_yolo3.py
"""Train YOLOv3 with random shapes.""" import argparse import os import logging import time import warnings import numpy as np import mxnet as mx from mxnet import nd from mxnet import gluon from mxnet import autograd import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import data as gdata from gluoncv ...
18,538
48.437333
149
py
gluon-cv
gluon-cv-master/scripts/detection/yolo/eval_yolo.py
from __future__ import division from __future__ import print_function import sys import argparse import logging logging.basicConfig(level=logging.INFO) import time import numpy as np import mxnet as mx from tqdm import tqdm from mxnet import nd from mxnet import gluon import gluoncv as gcv gcv.utils.check_version('0.6...
10,144
47.080569
137
py
gluon-cv
gluon-cv-master/scripts/detection/yolo/demo_yolo.py
"""YOLO Demo script.""" import os import argparse import mxnet as mx import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv.data.transforms import presets from matplotlib import pyplot as plt def parse_args(): parser = argparse.ArgumentParser(description='Test with YOLO networks.') parser.add_argu...
2,310
41.018182
92
py
gluon-cv
gluon-cv-master/scripts/tracking/siamrpn/test.py
""" SiamRPN test Code adapted from https://github.com/STVIR/pysot""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import os import numpy as np import mxnet as mx from gluoncv.model_zoo.siamrpn.siamrpn...
6,035
43.711111
99
py
gluon-cv
gluon-cv-master/scripts/tracking/siamrpn/demo.py
"""SiamRPN Demo script. Code adapted from https://github.com/STVIR/pysot""" import os import argparse import matplotlib.pyplot as plt import numpy as np import mxnet as mx from gluoncv import model_zoo, utils from gluoncv.model_zoo.siamrpn.siamrpn_tracker import SiamRPNTracker as build_tracker from gluoncv.model_zoo.si...
4,725
41.196429
107
py
gluon-cv
gluon-cv-master/scripts/tracking/siamrpn/train.py
""" SiamRPN train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import logging import os import time import numpy as np os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' import mxnet as mx from mx...
12,487
45.251852
100
py
gluon-cv
gluon-cv-master/scripts/gan/stylegan/modules.py
import numpy as np from math import sqrt import mxnet as mx import mxnet.ndarray as nd import mxnet.gluon.nn as nn from numpy import prod # pylint: disable-all def get_weight_key(module): for k in module.params.keys(): if 'weight' in k: weight_key = k return weight_key def compute_weigh...
10,695
34.892617
119
py
gluon-cv
gluon-cv-master/scripts/gan/stylegan/prepare_data.py
import argparse from io import BytesIO import multiprocessing from functools import partial from PIL import Image import lmdb from tqdm import tqdm from mxnet.gluon.data.vision.datasets import ImageFolderDataset # pylint: disable-all def resize_and_convert(img, size, quality=100): img = img.resize(size) buff...
1,921
26.070423
88
py
gluon-cv
gluon-cv-master/scripts/gan/stylegan/model.py
import random import numpy as np from math import sqrt import mxnet as mx import mxnet.ndarray as nd from modules import * # pylint: disable-all class Generator(nn.HybridBlock): def __init__(self, fused=True): super().__init__() self.progression = nn.HybridSequential() with self.progress...
7,948
34.486607
111
py
gluon-cv
gluon-cv-master/scripts/gan/stylegan/demo_stylegan.py
import argparse import math import os import numpy as np from tqdm import tqdm from PIL import Image import mxnet as mx import mxnet.ndarray as nd from model import StyledGenerator # pylint: disable-all def get_mean_style(generator, device): mean_style = None for i in range(10): style = generator.me...
2,567
26.319149
117
py
gluon-cv
gluon-cv-master/scripts/gan/stylegan/train.py
import os import random import math import argparse import logging import os.path as osp from io import BytesIO import lmdb import numpy as np from PIL import Image from tqdm import tqdm from mpl_toolkits.axes_grid1 import ImageGrid import matplotlib.pyplot as plt plt.switch_backend('agg') import mxnet as mx import m...
14,711
34.97066
129
py
gluon-cv
gluon-cv-master/scripts/gan/srgan/demo_srgan.py
from train_srgan import SRGenerator import mxnet as mx from mxnet.gluon.data.vision import transforms from matplotlib import pyplot as plt from gluoncv.utils import try_import_cv2 cv2 = try_import_cv2() from mxnet import image import argparse def parse_args(): parser = argparse.ArgumentParser(description='Test wit...
1,670
33.8125
92
py
gluon-cv
gluon-cv-master/scripts/gan/srgan/train_srgan.py
import argparse import random from mxnet import gluon, image,autograd from mxnet.gluon.data.vision import transforms from mxnet.gluon.data import DataLoader from mxnet.gluon import nn import mxnet.ndarray as nd import mxnet as mx from mxboard import SummaryWriter import os from mxnet.gluon.model_zoo import vision clas...
14,794
40.558989
170
py
gluon-cv
gluon-cv-master/scripts/gan/wgan/train_wgan.py
from __future__ import print_function import argparse from mxnet.image import image from mxnet.gluon.data.vision import transforms,CIFAR10,ImageFolderDataset from mxnet.gluon.data import DataLoader from mxnet.gluon import Trainer,nn from mxnet.base import numeric_types from mxnet.initializer import * from mxnet import ...
22,704
42.747592
158
py
gluon-cv
gluon-cv-master/scripts/gan/wgan/lsun.py
from __future__ import absolute_import from __future__ import division import os import numpy as np import mxnet as mx from mxnet import gluon from PIL import Image try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET import sys if sys.version_info[0] == 2: import ...
5,760
33.704819
110
py
gluon-cv
gluon-cv-master/scripts/gan/cycle_gan/train_cgan.py
import argparse import random from mxnet import gluon, image,autograd from mxnet.gluon.data.vision import transforms from mxnet.base import numeric_types import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import utils as gutils from mxnet.gluon.data import DataLoader from mxnet.gluon import nn import m...
25,361
41.913706
308
py
gluon-cv
gluon-cv-master/scripts/gan/cycle_gan/demo_cycle_gan.py
"""YOLO Demo script.""" import argparse import mxnet as mx from mxnet import image from matplotlib import pyplot as plt from mxnet.gluon.data.vision import transforms from .train_cgan import define_G,Resize def parse_args(): parser = argparse.ArgumentParser(description='Test with cycle gan networks.') parser.a...
2,337
41.509091
149
py
gluon-cv
gluon-cv-master/tests/model_zoo/test_utils_export.py
from __future__ import print_function import numpy as np import mxnet as mx import gluoncv as gcv from gluoncv.model_zoo.model_store import pretrained_model_list from ..unittests.common import try_gpu @try_gpu(0) def test_export_model_zoo(): for model in pretrained_model_list(): print('exporting:', model)...
2,800
34.910256
123
py
gluon-cv
gluon-cv-master/tests/model_zoo/test_model_zoo.py
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
29,500
42.511799
114
py
gluon-cv
gluon-cv-master/tests/unittests/test_data_datasets.py
from __future__ import print_function from __future__ import division import os import mxnet as mx import numpy as np import gluoncv as gcv from gluoncv import data from .tiny_datasets import COCODetectionTiny, COCOInstanceTiny, VOCDetectionTiny, VOCSegmentationTiny import os.path as osp import unittest def test_pa...
4,495
28.194805
101
py
gluon-cv
gluon-cv-master/tests/unittests/test_data_transforms.py
from __future__ import print_function from __future__ import division import os.path as osp import mxnet as mx import numpy as np from mxnet import autograd, gluon import gluoncv as gcv from gluoncv.data import transforms from gluoncv.data import batchify from gluoncv.data.batchify import Tuple, Stack, Pad from gluonc...
15,491
47.111801
152
py
gluon-cv
gluon-cv-master/tests/unittests/test_utils_segmentation.py
from tqdm import tqdm import unittest import numpy as np import mxnet as mx from mxnet.test_utils import assert_almost_equal from mxnet.gluon.data.vision import transforms import gluoncv from gluoncv.utils.metrics.segmentation import * from gluoncv.data import ADE20KSegmentation from .common import try_gpu, with_cpu ...
2,827
36.210526
89
py
gluon-cv
gluon-cv-master/tests/unittests/test_data_dataloader.py
from __future__ import print_function from __future__ import division import mxnet as mx import numpy as np import gluoncv as gcv from gluoncv.data.batchify import * from gluoncv.data import DetectionDataLoader, RandomTransformDataLoader class DummyDetectionDataset(mx.gluon.data.Dataset): def __init__(self, siz...
3,381
31.519231
134
py
gluon-cv
gluon-cv-master/tests/unittests/test_lr_scheduler.py
from __future__ import print_function from __future__ import division import os.path as osp import mxnet as mx import numpy as np import gluoncv as gcv from mxnet import autograd, gluon from math import pi, cos from gluoncv.utils import LRScheduler, LRSequential def compare(obj, niter, expect, **kwargs): np.test...
5,219
34.27027
86
py
gluon-cv
gluon-cv-master/tests/unittests/tiny_datasets.py
import os from gluoncv import data class COCODetectionTiny(data.COCODetection): CLASSES = ['bicycle', 'motorcycle'] def __init__(self, root=os.path.join('~', '.mxnet', 'datasets', 'tiny_coco'), splits=('instances_val2017_tiny',), **kwargs): super().__init__(root=root, splits=splits, *...
1,252
38.15625
106
py
gluon-cv
gluon-cv-master/tests/unittests/test_utils_parallel.py
import mxnet as mx from mxnet import nd, autograd, gluon from mxnet.gluon import nn, Block from gluoncv.utils.parallel import DataParallelModel, DataParallelCriterion def test_data_parallel(): # test gluon.contrib.parallel.DataParallelModel net = nn.HybridSequential() with net.name_scope(): net.add...
1,922
34.611111
84
py
gluon-cv
gluon-cv-master/tests/unittests/common.py
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
10,028
35.736264
105
py
gluon-cv
gluon-cv-master/tests/unittests/test_utils_metric.py
from __future__ import print_function import numpy as np import gluoncv as gcv import mxnet as mx from mxnet import autograd, gluon from gluoncv.utils import download, viz def test_voc07_metric_difficult(): url = 'https://apache-mxnet.s3-accelerate.amazonaws.com/gluon/dataset/pikachu/train.rec' idx_url = 'htt...
3,204
37.614458
104
py
gluon-cv
gluon-cv-master/tests/unittests/test_utils_block.py
from __future__ import print_function import numpy as np import gluoncv as gcv from mxnet.gluon.nn import BatchNorm def check_bn_frozen_callback(net, value): if isinstance(net, BatchNorm): assert value == net._kwargs['use_global_stats'] def test_block_freeze_bn(): net = gcv.model_zoo.get_model('resne...
686
30.227273
73
py
gluon-cv
gluon-cv-master/tests/unittests/test_utils_viz.py
from __future__ import print_function from __future__ import division import unittest import mxnet as mx import numpy as np import gluoncv as gcv def test_viz_bbox(): img = mx.nd.zeros((300, 300, 3), dtype=np.uint8) bbox = mx.nd.array([[10, 20, 200, 500], [150, 200, 400, 300]]) scores = mx.nd.array([0.8,...
3,364
35.182796
109
py
gluon-cv
gluon-cv-master/tests/unittests/test_nn.py
import mxnet as mx from gluoncv.nn import GroupNorm def test_groupnorm(): ctx=mx.context.current_context() x = mx.nd.random.uniform(1, 2, (4, 16, 8, 8), ctx=ctx) gn = GroupNorm(4, 16) gn.initialize(ctx=ctx) y = gn(x) y = y.reshape(0, 4, -1) print('y.mean(2) =', y.mean(2)) mx.test_utils....
563
28.684211
76
py
gluon-cv
gluon-cv-master/tests/auto/test_torch_auto_estimators.py
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
7,169
40.929825
141
py
gluon-cv
gluon-cv-master/tests/auto/test_torch_auto_tasks.py
from gluoncv.auto.tasks import ImageClassification import autogluon.core as ag from nose.tools import nottest IMAGE_CLASS_DATASET, _, IMAGE_CLASS_TEST = ImageClassification.Dataset.from_folders( 'https://autogluon.s3.amazonaws.com/datasets/shopee-iet.zip') def test_torch_image_classification(): from gluoncv.a...
1,166
39.241379
100
py
gluon-cv
gluon-cv-master/tests/auto/test_auto_estimators.py
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
7,396
48.313333
135
py
gluon-cv
gluon-cv-master/tests/model_zoo_torch/test_tvm_torch_export.py
import tvm from tvm import relay from tvm.contrib import graph_executor from PIL import Image import numpy as np import torch import torchvision.transforms as T import torchvision from torchvision import transforms from gluoncv.torch.engine.config import get_cfg_defaults from gluoncv.torch import model_zoo def _test_...
4,293
33.629032
114
py
gluon-cv
gluon-cv-master/tests/model_zoo_torch/test_model_zoo_torch.py
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
8,441
37.547945
97
py
gluon-cv
gluon-cv-master/tests/onnx/test_inference.py
class Model(): def __init__(self, model_name, input_shape, model_type): self.model_name = model_name self.model_type = model_type if len(input_shape) == 4: input_shape.append(input_shape.pop(1)) # change BCHW to BHWC self.input_shape = tuple(input_shape) self...
9,437
45.722772
108
py
gluon-cv
gluon-cv-master/gluoncv/check.py
"""Pre init checks""" import sys def _require_mxnet_version(mx_version, max_mx_version='2.0.0'): try: import mxnet as mx from distutils.version import LooseVersion if LooseVersion(mx.__version__) < LooseVersion(mx_version) or \ LooseVersion(mx.__version__) >= LooseVersion(max_mx...
2,142
45.586957
115
py
gluon-cv
gluon-cv-master/gluoncv/loss.py
# pylint: disable=arguments-differ """Custom losses. Losses are subclasses of gluon.loss.Loss which is a HybridBlock actually. """ from __future__ import absolute_import from mxnet import gluon from mxnet import nd from mxnet.gluon.loss import Loss, _apply_weighting, _reshape_like __all__ = ['FocalLoss', 'SSDMultiBoxL...
27,925
41.440729
100
py
gluon-cv
gluon-cv-master/gluoncv/__init__.py
# coding: utf-8 # pylint: disable=wrong-import-position """GluonCV: a deep learning vision toolkit powered by Gluon.""" from __future__ import absolute_import from .check import _deprecate_python2 from .check import _require_mxnet_version, _require_pytorch_version __version__ = '0.11.0' _deprecate_python2() # optio...
1,251
28.809524
116
py
gluon-cv
gluon-cv-master/gluoncv/nn/dropblock.py
# pylint: disable=arguments-differ,line-too-long,missing-docstring,missing-module-docstring from functools import partial import mxnet as mx from mxnet.gluon.nn import HybridBlock __all__ = ['DropBlock', 'set_drop_prob', 'DropBlockScheduler'] class DropBlock(HybridBlock): def __init__(self, drop_prob, block_size,...
2,596
37.191176
125
py
gluon-cv
gluon-cv-master/gluoncv/nn/sampler.py
# pylint: disable=arguments-differ, unused-argument """Samplers for positive/negative/ignore sample selections. This module is used to select samples during training. Based on different strategies, we would like to choose different number of samples as positive, negative or ignore(don't care). The purpose is to allevia...
16,048
43.704735
98
py
gluon-cv
gluon-cv-master/gluoncv/nn/predictor.py
# pylint: disable=unused-argument,arguments-differ """Predictor for classification/box prediction.""" from __future__ import absolute_import import mxnet as mx from mxnet.gluon import HybridBlock from mxnet.gluon import nn class ConvPredictor(HybridBlock): """Convolutional predictor. Convolutional predictor i...
2,737
36
97
py
gluon-cv
gluon-cv-master/gluoncv/nn/matcher.py
# pylint: disable=arguments-differ """Matchers for target assignment. Matchers are commonly used in object-detection for anchor-groundtruth matching. The matching process is a prerequisite to training target assignment. Matching is usually not required during testing. """ from __future__ import absolute_import from mxn...
4,518
36.040984
95
py
gluon-cv
gluon-cv-master/gluoncv/nn/block.py
# pylint: disable=abstract-method,unused-argument,arguments-differ,missing-docstring """Customized Layers. """ from __future__ import absolute_import from mxnet import initializer from mxnet.gluon import nn, contrib from mxnet.gluon.nn import BatchNorm, HybridBlock __all__ = ['BatchNormCudnnOff', 'Consensus', 'ReLU6',...
5,889
31.185792
93
py
gluon-cv
gluon-cv-master/gluoncv/nn/gn.py
# pylint: disable= arguments-differ,missing-docstring """Basic neural network layers.""" __all__ = ['GroupNorm'] import numpy as np from mxnet.gluon.block import HybridBlock from mxnet import autograd class GroupNorm(HybridBlock): """GroupNorm normalization layer (Wu and He, 2014). Parameters ---------- ...
3,998
42
91
py
gluon-cv
gluon-cv-master/gluoncv/nn/coder.py
# pylint: disable=arguments-differ, missing-docstring """Encoder and Decoder functions. Encoders are used during training, which assign training targets. Decoders are used during testing/validation, which convert predictions back to normal boxes, etc. """ from __future__ import absolute_import import numpy as np from ...
21,869
42.652695
99
py
gluon-cv
gluon-cv-master/gluoncv/nn/bbox.py
# pylint: disable=arguments-differ """Bounding boxes operators""" from __future__ import absolute_import import numpy as np from mxnet import gluon class NumPyBBoxCornerToCenter(object): """Convert corner boxes to center boxes using numpy. Corner boxes are encoded as (xmin, ymin, xmax, ymax) Center boxes...
9,033
32.335793
96
py
gluon-cv
gluon-cv-master/gluoncv/nn/splat.py
# pylint: disable=arguments-differ,line-too-long,missing-docstring,missing-module-docstring from mxnet.gluon import nn from mxnet.gluon.nn import Conv2D, HybridBlock, BatchNorm, Activation __all__ = ['SplitAttentionConv'] class SplitAttentionConv(HybridBlock): # pylint: disable=keyword-arg-before-vararg def ...
2,674
40.796875
97
py
gluon-cv
gluon-cv-master/gluoncv/nn/feature.py
# pylint: disable=abstract-method """Feature extraction blocks. Feature or Multi-Feature extraction is a key component in object detection. Class predictor/Box predictor are usually applied on feature layer(s). A good feature extraction mechanism is critical to performance. """ from __future__ import absolute_import i...
13,074
45.365248
95
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/pspnet.py
# pylint: disable=unused-argument """Pyramid Scene Parsing Network""" from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from .segbase import SegBaseModel from .fcn import _FCNHead # pylint: disable-all __all__ = ['PSPNet', 'get_psp', 'get_psp_resnet101_coco', 'get_psp_resn...
10,991
37.840989
103
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/dla.py
"""Deep Layer Aggregation networks, implemented in Gluon.""" # pylint: disable=arguments-differ,unused-argument,missing-docstring from __future__ import division import os import mxnet as mx from mxnet.gluon.block import HybridBlock from mxnet.gluon import nn from mxnet.gluon.nn import BatchNorm __all__ = ['DLA', 'g...
15,068
39.508065
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/hrnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
30,537
39.609043
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/icnet.py
# pylint: disable=unused-argument,abstract-method,missing-docstring,arguments-differ """Image Cascade Network (ICNet) ICNet for Real-Time Semantic Segmentation on High-Resolution Images, ECCV 2018 https://hszhao.github.io/projects/icnet/ Code partially borrowed from https://github.com/lxtGH/Fast_Seg/blob/master/libs/mo...
15,511
38.876607
98
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/fcn.py
"""Fully Convolutional Network with Stride of 8""" from __future__ import division from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from .segbase import SegBaseModel # pylint: disable=unused-argument,abstract-method,missing-docstring __all__ = ['FCN', 'get_fcn', 'get_fcn_...
9,745
38.942623
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/residual_attentionnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
37,859
40.604396
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/inception.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
12,026
45.797665
98
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/resnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
44,671
43.185955
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/danet.py
"""Dual Attention Network https://arxiv.org/abs/1809.02983""" from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from .segbase import SegBaseModel from .fcn import _FCNHead from .attention import PAM_Module, CAM_Module # pylint: disable-all __all__ = ['DANet', 'get_danet', ...
7,480
37.364103
111
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/squeezenet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
7,924
44.028409
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/vgg.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
10,601
39.776923
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/deeplabv3_plus.py
"""Pyramid Scene Parsing Network""" from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from mxnet import gluon from .fcn import _FCNHead from .xception import get_xcetption # pylint: disable-all __all__ = ['DeepLabV3Plus', 'get_deeplab_plus', 'get_deeplab_plus_xception_coco...
11,908
38.564784
105
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/model_zoo.py
# pylint: disable=wildcard-import, unused-wildcard-import, line-too-long """Model store which handles pretrained models from both mxnet.gluon.model_zoo.vision and gluoncv.models """ from .alexnet import * from .cifarresnet import * from .cifarresnext import * from .cifarwideresnet import * from .deeplabv3 import * from...
20,134
46.154567
119
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/densenet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
11,361
43.732283
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/googlenet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
16,594
46.550143
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/cifarresnext.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
10,168
40.337398
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/mobilenetv3.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
14,730
41.209169
132
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/resnext.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
22,119
41.868217
123
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/senet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
12,769
41.566667
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/shufflenet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
10,245
43.547826
181
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/deeplabv3b_plus.py
"""DeepLabV3+ with wideresnet backbone for semantic segmentation""" # pylint: disable=missing-docstring,arguments-differ,unused-argument from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from .wideresnet import wider_resnet38_a2 __all__ = ['DeepLabWV3Plus', 'get_deeplabv3b...
11,172
39.777372
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/segbase.py
"""Base Model for Semantic Segmentation""" import math import warnings import numpy as np import mxnet as mx from mxnet.ndarray import NDArray from mxnet.gluon.nn import HybridBlock from ..utils.parallel import parallel_apply from .resnetv1b import resnet18_v1b, resnet34_v1b, resnet50_v1s, resnet101_v1s, resnet152_v1s ...
9,515
35.45977
108
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/deeplabv3.py
# pylint: disable=unused-argument """Pyramid Scene Parsing Network""" from mxnet.gluon import nn from mxnet.context import cpu from mxnet.gluon.nn import HybridBlock from mxnet import gluon from .segbase import SegBaseModel from .fcn import _FCNHead # pylint: disable-all __all__ = ['DeepLabV3', 'get_deeplab', 'get_dee...
17,099
37
104
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/model_store.py
# pylint: disable=wildcard-import, unused-wildcard-import, line-too-long """Model store which provides pretrained models.""" from __future__ import print_function __all__ = ['get_model_file', 'purge'] import os import zipfile import logging import portalocker from ..utils import download, check_sha1 _model_sha1 = {n...
20,595
59.222222
106
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/resnest.py
"""ResNeSt implemented in Gluon.""" # pylint: disable=arguments-differ,unused-argument,missing-docstring,line-too-long from __future__ import division import math from mxnet.context import cpu from mxnet.gluon import nn from mxnet.gluon.block import HybridBlock from mxnet.gluon.nn import BatchNorm from ..nn.dropbloc...
27,942
49.897996
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/nasnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
38,745
46.136253
98
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/cifarwideresnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
11,305
41.344569
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/resnetv1b.py
"""ResNetV1bs, implemented in Gluon.""" # pylint: disable=arguments-differ,unused-argument,missing-docstring from __future__ import division from mxnet.context import cpu from mxnet.gluon.block import HybridBlock from mxnet.gluon import nn from mxnet.gluon.nn import BatchNorm __all__ = ['ResNetV1b', 'resnet18_v1b', '...
42,083
46.232323
100
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/xception.py
# code adapted from https://github.com/jfzhang95/pytorch-deeplab-xception/ # pylint: disable=arguments-differ,unused-argument,missing-docstring,unused-variable """Xception, implemented in Gluon.""" __all__ = ['Xception65', 'Xception71', 'get_xcetption', 'get_xcetption_71'] from mxnet.context import cpu import mxnet.glu...
16,952
41.276808
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/se_resnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
31,038
42.16968
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/mobilenet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
21,825
42.134387
98
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/attention.py
import mxnet as mx from mxnet.gluon import nn from mxnet.gluon.nn import HybridBlock # pylint: disable-all __all__ = ['PAM_Module', 'CAM_Module'] class PAM_Module(HybridBlock): r""" Position attention module from the paper `"Dual Attention Network for Scene Segmentation" <https://arxiv.org/abs/1809.02983...
2,946
36.782051
95
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/fastscnn.py
# pylint: disable=unused-argument, arguments-differ, unused-variable """Fast-SCNN, implemented in Gluon. Code adapted from lxtGH/Fast_Seg""" __all__ = ['FastSCNN', 'get_fastscnn', 'get_fastscnn_citys'] from mxnet.context import cpu from mxnet.gluon.block import HybridBlock from mxnet.gluon import nn class FastSCNN(H...
18,075
43.087805
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/cifarresnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
18,598
40.984199
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/wideresnet.py
""" # Code adapted from: # https://github.com/mapillary/inplace_abn/ # # BSD 3-Clause License # # Copyright (c) 2017, mapillary # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistribution...
13,143
38.119048
93
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/alexnet.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
3,898
41.380435
95
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/ssd.py
"""Single-shot Multi-box Detector.""" from __future__ import absolute_import import os import warnings import mxnet as mx from mxnet import autograd from mxnet.gluon import nn from mxnet.gluon import HybridBlock from gluoncv.nn.feature import FeatureExpander from gluoncv.nn.predictor import ConvPredictor from gluonc...
24,301
47.995968
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/presets.py
"""SSD predefined models.""" from __future__ import absolute_import import warnings from gluoncv.data import VOCDetection from .ssd import get_ssd from ..ssd.anchor import LiteAnchorGenerator from ..ssd.vgg_atrous import vgg16_atrous_300, vgg16_atrous_512 __all__ = ['ssd_300_vgg16_atrous_voc', 'ssd_300_vg...
38,904
43.564719
98
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/general_detector.py
""" Provide a general object detector interface for SMOT """ # pylint: disable=unused-wildcard-import,wildcard-import import logging import numpy as np import mxnet as mx from gluoncv.data import COCODetection from .utils import mxnet_frame_preprocessing, timeit_context from .utils import remap_bboxes as _remap_bboxe...
7,119
42.950617
141
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/utils.py
""" Utility functions for SMOT: Single-Shot Multi Object Tracking https://arxiv.org/abs/2010.16031 """ import time import logging from contextlib import contextmanager import mxnet as mx import numpy as np def timeit(method): """ The timing decorator to wrap the functions """ def timed(*args, **kw): ...
7,118
30.361233
118
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/smot_tracker.py
""" MXNet implementation of tracktor in SMOT: Single-Shot Multi Object Tracking https://arxiv.org/abs/2010.16031 """ # pylint: disable=line-too-long,logging-format-interpolation,unused-argument,missing-function-docstring from __future__ import absolute_import import logging import time import numpy as np import mxnet ...
23,712
42.590074
139
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/smot/tracktors.py
""" Tractor module for SMOT """ # pylint: disable=arguments-differ from abc import ABC, abstractmethod import numpy as np import mxnet as mx from .utils import timeit from .general_detector import GeneralDetector class BaseAnchorBasedTracktor(ABC): """ BaseAnchorBasedTracktor """ @abstractmethod ...
4,809
33.113475
113
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/pruned_resnet/resnetv1b_pruned.py
"""Pruned ResNetV1bs, implemented in Gluon.""" from __future__ import division import json import os from mxnet.context import cpu from mxnet.gluon import nn from mxnet import ndarray from ..resnetv1b import ResNetV1b from ..resnetv1b import BasicBlockV1b from ..resnetv1b import BottleneckV1b __all__ = ['resnet18_v1b...
14,937
44.963077
99
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/quantized/quantized.py
# pylint: skip-file # pylint: disable=line-too-long """Create quantized model from JSON files...""" import os import warnings import mxnet as mx from mxnet.context import cpu from mxnet.gluon import SymbolBlock from gluoncv.utils.compress_json import get_compressed_model __all__ = ['mobilenet1_0_int8', 'resnet50_v1_in...
306,826
2,159.753521
25,875
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/ssd/target.py
"""SSD training target generator.""" from __future__ import absolute_import from mxnet import nd from mxnet.gluon import Block from ...nn.matcher import CompositeMatcher, BipartiteMatcher, MaximumMatcher from ...nn.sampler import OHEMSampler, NaiveSampler from ...nn.coder import MultiClassEncoder, NormalizedBoxCenterE...
2,354
42.611111
87
py
gluon-cv
gluon-cv-master/gluoncv/model_zoo/ssd/ssd.py
"""Single-shot Multi-box Detector.""" from __future__ import absolute_import import os import warnings import mxnet as mx from mxnet import autograd from mxnet.gluon import nn from mxnet.gluon import HybridBlock from ...nn.feature import FeatureExpander from .anchor import SSDAnchorGenerator from ...nn.predictor impor...
23,701
50.30303
99
py