Search is not available for this dataset
repo
stringlengths
2
152
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
IID_representation_learning
IID_representation_learning-master/restyle/models/e4e_modules/discriminator.py
from torch import nn class LatentCodesDiscriminator(nn.Module): def __init__(self, style_dim, n_mlp): super().__init__() self.style_dim = style_dim layers = [] for i in range(n_mlp-1): layers.append( nn.Linear(style_dim, style_dim) ) ...
496
22.666667
47
py
IID_representation_learning
IID_representation_learning-master/restyle/models/e4e_modules/latent_codes_pool.py
import random import torch class LatentCodesPool: """This class implements latent codes buffer that stores previously generated w latent codes. This buffer enables us to update discriminators using a history of generated w's rather than the ones produced by the latest encoder. """ def __init__(se...
2,349
40.964286
141
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/fpn_encoders.py
import torch import torch.nn.functional as F from torch import nn from torch.nn import Conv2d, BatchNorm2d, PReLU, Sequential, Module from torchvision.models.resnet import resnet34 from models.encoders.helpers import get_blocks, bottleneck_IR, bottleneck_IR_SE from models.encoders.map2style import GradualStyleBlock ...
5,672
34.45625
114
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/helpers.py
from collections import namedtuple import torch from torch.nn import Conv2d, BatchNorm2d, PReLU, ReLU, Sigmoid, MaxPool2d, AdaptiveAvgPool2d, Sequential, Module """ ArcFace implementation from [TreB1eN](https://github.com/TreB1eN/InsightFace_Pytorch) """ class Flatten(Module): def forward(self, input): return inp...
3,556
28.641667
112
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/map2style.py
import numpy as np from torch import nn from torch.nn import Conv2d, Module from models.stylegan2.model import EqualLinear class GradualStyleBlock(Module): def __init__(self, in_c, out_c, spatial): super(GradualStyleBlock, self).__init__() self.out_c = out_c self.spatial = spatial ...
1,887
32.714286
76
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/model_irse.py
from torch.nn import Linear, Conv2d, BatchNorm1d, BatchNorm2d, PReLU, Dropout, Sequential, Module from models.encoders.helpers import get_blocks, Flatten, bottleneck_IR, bottleneck_IR_SE, l2_norm """ Modified Backbone implementation from [TreB1eN](https://github.com/TreB1eN/InsightFace_Pytorch) """ class Backbone(Mo...
2,836
32.376471
97
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/restyle_e4e_encoders.py
from enum import Enum from torch import nn from torch.nn import Conv2d, BatchNorm2d, PReLU, Sequential, Module from torchvision.models import resnet34 from models.encoders.helpers import get_blocks, bottleneck_IR, bottleneck_IR_SE from models.encoders.map2style import GradualStyleBlock class ProgressiveStage(Enum): ...
5,676
36.846667
120
py
IID_representation_learning
IID_representation_learning-master/restyle/models/encoders/restyle_psp_encoders.py
import torch from torch import nn from torch.nn import Conv2d, BatchNorm2d, PReLU, Sequential, Module from torchvision.models.resnet import resnet34 from models.encoders.helpers import get_blocks, bottleneck_IR, bottleneck_IR_SE from models.encoders.map2style import GradualStyleBlock, GradualNoiseBlock class Backbon...
4,334
35.737288
120
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn.py
import numpy as np import torch from PIL import Image from models.mtcnn.mtcnn_pytorch.src.get_nets import PNet, RNet, ONet from models.mtcnn.mtcnn_pytorch.src.box_utils import nms, calibrate_box, get_image_boxes, convert_to_square from models.mtcnn.mtcnn_pytorch.src.first_stage import run_first_stage from models.mtcnn....
6,220
38.624204
116
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/__init__.py
from .visualization_utils import show_bboxes from .detector import detect_faces
80
26
44
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/align_trans.py
# -*- coding: utf-8 -*- """ Created on Mon Apr 24 15:43:29 2017 @author: zhaoy """ import numpy as np import cv2 # from scipy.linalg import lstsq # from scipy.ndimage import geometric_transform # , map_coordinates from models.mtcnn.mtcnn_pytorch.src.matlab_cp2tform import get_similarity_transform_for_cv2 # referenc...
11,036
35.186885
109
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/box_utils.py
import numpy as np from PIL import Image def nms(boxes, overlap_threshold=0.5, mode='union'): """Non-maximum suppression. Arguments: boxes: a float numpy array of shape [n, 5], where each row is (xmin, ymin, xmax, ymax, score). overlap_threshold: a float number. mode: 'uni...
6,936
28.025105
90
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/detector.py
import numpy as np import torch from .get_nets import PNet, RNet, ONet from .box_utils import nms, calibrate_box, get_image_boxes, convert_to_square from .first_stage import run_first_stage def detect_faces(image, min_face_size=20.0, thresholds=[0.6, 0.7, 0.8], nms_thresholds=[0.7, 0...
4,333
33.396825
101
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/first_stage.py
import torch import math from PIL import Image import numpy as np from .box_utils import nms, _preprocess # device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") device = 'cuda:0' def run_first_stage(image, net, scale, threshold): """Run P-Net, generate bounding boxes, and do NMS. Argument...
3,147
30.168317
76
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/get_nets.py
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict import numpy as np from configs.paths_config import model_paths PNET_PATH = model_paths["mtcnn_pnet"] ONET_PATH = model_paths["mtcnn_onet"] RNET_PATH = model_paths["mtcnn_rnet"] class Flatten(nn.Module): def _...
4,995
28.046512
65
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/matlab_cp2tform.py
# -*- coding: utf-8 -*- """ Created on Tue Jul 11 06:54:28 2017 @author: zhaoyafei """ import numpy as np from numpy.linalg import inv, norm, lstsq from numpy.linalg import matrix_rank as rank class MatlabCp2tormException(Exception): def __str__(self): return 'In File {}:{}'.format( __file__...
8,562
23.396011
77
py
IID_representation_learning
IID_representation_learning-master/restyle/models/mtcnn/mtcnn_pytorch/src/visualization_utils.py
from PIL import ImageDraw def show_bboxes(img, bounding_boxes, facial_landmarks=[]): """Draw bounding boxes and facial landmarks. Arguments: img: an instance of PIL.Image. bounding_boxes: a float numpy array of shape [n, 5]. facial_landmarks: a float numpy array of shape [n, 10]. ...
786
23.59375
63
py
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/model.py
import math import random import torch from torch import nn from torch.nn import functional as F from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d class PixelNorm(nn.Module): def __init__(self): super().__init__() def forward(self, input): return input * torch.rsqrt...
18,559
26.537092
100
py
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/op/__init__.py
from .fused_act import FusedLeakyReLU, fused_leaky_relu from .upfirdn2d import upfirdn2d
89
29
55
py
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/op/fused_act.py
import os import torch from torch import nn from torch.autograd import Function from torch.utils.cpp_extension import load module_path = os.path.dirname(__file__) fused = load( 'fused', sources=[ os.path.join(module_path, 'fused_bias_act.cpp'), os.path.join(module_path, 'fused_bias_act_kernel....
2,378
26.662791
83
py
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/op/fused_bias_act.cpp
#include <torch/extension.h> torch::Tensor fused_bias_act_op(const torch::Tensor& input, const torch::Tensor& bias, const torch::Tensor& refer, int act, int grad, float alpha, float scale); #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor") #define CHECK_CONTIGUOUS(x) TORCH_CHECK(...
826
38.380952
114
cpp
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/op/upfirdn2d.cpp
#include <torch/extension.h> torch::Tensor upfirdn2d_op(const torch::Tensor& input, const torch::Tensor& kernel, int up_x, int up_y, int down_x, int down_y, int pad_x0, int pad_x1, int pad_y0, int pad_y1); #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #...
966
41.043478
99
cpp
IID_representation_learning
IID_representation_learning-master/restyle/models/stylegan2/op/upfirdn2d.py
import os import torch from torch.autograd import Function from torch.utils.cpp_extension import load module_path = os.path.dirname(__file__) upfirdn2d_op = load( 'upfirdn2d', sources=[ os.path.join(module_path, 'upfirdn2d.cpp'), os.path.join(module_path, 'upfirdn2d_kernel.cu'), ], ) cla...
5,203
27.12973
108
py
IID_representation_learning
IID_representation_learning-master/restyle/options/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/options/e4e_train_options.py
from options.train_options import TrainOptions class e4eTrainOptions(TrainOptions): def __init__(self): super(e4eTrainOptions, self).__init__() def initialize(self): super(e4eTrainOptions, self).initialize() self.parser.add_argument('--w_discriminator_lambda', default=0, type=float, ...
3,016
58.156863
120
py
IID_representation_learning
IID_representation_learning-master/restyle/options/test_options.py
from argparse import ArgumentParser class TestOptions: def __init__(self): self.parser = ArgumentParser() self.initialize() def initialize(self): # arguments for inference script self.parser.add_argument('--exp_dir', type=str, help='Path to ex...
2,530
51.729167
115
py
IID_representation_learning
IID_representation_learning-master/restyle/options/train_options.py
from argparse import ArgumentParser class TrainOptions: def __init__(self): self.parser = ArgumentParser() self.initialize() def initialize(self): # general setup self.parser.add_argument('--exp_dir', type=str, help='Path to experiment output ...
4,690
54.188235
115
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/align_faces_parallel.py
""" brief: face alignment with FFHQ method (https://github.com/NVlabs/ffhq-dataset) author: lzhbrian (https://lzhbrian.me) date: 2020.1.5 note: code is heavily borrowed from https://github.com/NVlabs/ffhq-dataset http://dlib.net/face_landmark_detection.py.html requirements: apt install cmake conda install Pillow n...
6,988
32.927184
117
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/calc_id_loss_parallel.py
from argparse import ArgumentParser import time import numpy as np import os import json import sys from PIL import Image import multiprocessing as mp import math import torch import torchvision.transforms as trans sys.path.append(".") sys.path.append("..") from models.mtcnn.mtcnn import MTCNN from models.encoders.mo...
3,804
27.609023
111
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/calc_losses_on_images.py
from argparse import ArgumentParser import os import json import sys from tqdm import tqdm import numpy as np import torch from torch.utils.data import DataLoader import torchvision.transforms as transforms sys.path.append(".") sys.path.append("..") from criteria.lpips.lpips import LPIPS from datasets.gt_res_dataset ...
2,822
27.515152
85
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/encoder_bootstrapping_inference.py
import os from argparse import Namespace from tqdm import tqdm import time import numpy as np import torch from PIL import Image from torch.utils.data import DataLoader import sys from utils.inference_utils import get_average_image sys.path.append(".") sys.path.append("..") from configs import data_configs from dat...
5,208
34.678082
110
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/inference_iterative.py
import os from argparse import Namespace from tqdm import tqdm import time import numpy as np import torch from torch.utils.data import DataLoader import sys sys.path.append(".") sys.path.append("..") from configs import data_configs from datasets.inference_dataset import InferenceDataset from options.test_options im...
3,601
32.351852
106
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/inference_iterative_save_coupled.py
import os from argparse import Namespace from tqdm import tqdm import time import numpy as np import torch from PIL import Image from torch.utils.data import DataLoader import sys sys.path.append(".") sys.path.append("..") from configs import data_configs from datasets.inference_dataset import InferenceDataset from o...
3,513
32.466667
106
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/train_restyle_e4e.py
""" This file runs the main training/val loop """ import os import json import math import sys import pprint import torch from argparse import Namespace sys.path.append(".") sys.path.append("..") from options.e4e_train_options import e4eTrainOptions from training.coach_restyle_e4e import Coach def main(): opts = e...
2,438
27.360465
95
py
IID_representation_learning
IID_representation_learning-master/restyle/scripts/train_restyle_psp.py
""" This file runs the main training/val loop """ import os import json import sys import pprint sys.path.append(".") sys.path.append("..") from options.train_options import TrainOptions from training.coach_restyle_psp import Coach def main(): opts = TrainOptions().parse() os.makedirs(opts.exp_dir, exist_ok=True)...
560
17.096774
61
py
IID_representation_learning
IID_representation_learning-master/restyle/training/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/training/coach_restyle_e4e.py
from models.encoders.restyle_e4e_encoders import ProgressiveStage from models.e4e_modules.discriminator import LatentCodesDiscriminator from models.e4e_modules.latent_codes_pool import LatentCodesPool from training.ranger import Ranger from models.e4e import e4e from criteria.lpips.lpips import LPIPS from datasets.imag...
24,241
43.318099
129
py
IID_representation_learning
IID_representation_learning-master/restyle/training/coach_restyle_psp.py
from training.ranger import Ranger from models.psp import pSp from criteria.lpips.lpips import LPIPS from wilds import get_dataset from wilds.common.data_loaders import get_train_loader, get_eval_loader from configs import data_configs from criteria import id_loss, w_norm, moco_loss from utils import common, train_util...
15,114
42.811594
129
py
IID_representation_learning
IID_representation_learning-master/restyle/training/ranger.py
# Ranger deep learning optimizer - RAdam + Lookahead + Gradient Centralization, combined into one optimizer. # https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer # and/or # https://github.com/lessw2020/Best-Deep-Learning-Optimizers # Ranger has now been used to capture 12 records on the FastAI leaderboard. ...
5,899
34.97561
169
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/__init__.py
0
0
0
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/common.py
from PIL import Image import matplotlib.pyplot as plt def tensor2im(var): var = var.cpu().detach().transpose(0, 2).transpose(0, 1).numpy() var = ((var + 1) / 2) var[var < 0] = 0 var[var > 1] = 1 var = var * 255 return Image.fromarray(var.astype('uint8')) def vis_faces(log_hooks): display...
1,486
35.268293
88
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/data_utils.py
""" Code adopted from pix2pixHD: https://github.com/NVIDIA/pix2pixHD/blob/master/data/image_folder.py """ import os import torch IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tiff' ] def is_image_file(filename): return any(filename.endswith(extensi...
1,541
31.808511
110
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/inference_utils.py
import torch def get_average_image(net, opts): avg_image = net(net.latent_avg.unsqueeze(0), input_code=True, randomize_noise=False, return_latents=False, average_code=True)[0] avg_image = avg_image.to('cuda').float().detach() ...
1,879
35.862745
89
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/model_utils.py
# specify the encoder types for pSp and e4e - this is mainly used for the inference scripts ENCODER_TYPES = { 'pSp': ['GradualStyleEncoder', 'ResNetGradualStyleEncoder', 'BackboneEncoder', 'ResNetBackboneEncoder'], 'e4e': ['ProgressiveBackboneEncoder', 'ResNetProgressiveBackboneEncoder'] } RESNET_MAPPING = { ...
743
28.76
108
py
IID_representation_learning
IID_representation_learning-master/restyle/utils/train_utils.py
def aggregate_loss_dict(agg_loss_dict): mean_vals = {} for output in agg_loss_dict: for key in output: mean_vals[key] = mean_vals.setdefault(key, []) + [output[key]] for key in mean_vals: if len(mean_vals[key]) > 0: mean_vals[key] = sum(mean_vals[key]) / len(mean_vals[key]) else: print('{} has no val...
377
26
65
py
mmdetection
mmdetection-master/.owners.yml
assign: strategy: # random daily-shift-based scedule: "*/1 * * * *" assignees: - Czm369 - hhaAndroid - zwhus - RangiLyu - BIGWangYuDong - ZwwWayne - ZwwWayne
200
13.357143
24
yml
mmdetection
mmdetection-master/.pre-commit-config.yaml
repos: - repo: https://github.com/PyCQA/flake8 rev: 5.0.4 hooks: - id: flake8 - repo: https://github.com/PyCQA/isort rev: 5.11.5 hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-yapf rev: v0.32.0 hooks: - id: yapf - repo: https://github.com/pre-commit/pr...
1,452
27.490196
89
yaml
mmdetection
mmdetection-master/.readthedocs.yml
version: 2 formats: all python: version: 3.8 install: - requirements: requirements/docs.txt - requirements: requirements/readthedocs.txt
151
14.2
48
yml
mmdetection
mmdetection-master/README.md
<div align="center"> <img src="resources/mmdet-logo.png" width="600"/> <div>&nbsp;</div> <div align="center"> <b><font size="5">OpenMMLab website</font></b> <sup> <a href="https://openmmlab.com"> <i><font size="4">HOT</font></i> </a> </sup> &nbsp;&nbsp;&nbsp;&nbsp; <b><font...
22,446
53.615572
560
md
mmdetection
mmdetection-master/README_zh-CN.md
<div align="center"> <img src="resources/mmdet-logo.png" width="600"/> <div>&nbsp;</div> <div align="center"> <b><font size="5">OpenMMLab 官网</font></b> <sup> <a href="https://openmmlab.com"> <i><font size="4">HOT</font></i> </a> </sup> &nbsp;&nbsp;&nbsp;&nbsp; <b><font size...
18,742
44.055288
367
md
mmdetection
mmdetection-master/model-index.yml
Import: - configs/atss/metafile.yml - configs/autoassign/metafile.yml - configs/carafe/metafile.yml - configs/cascade_rcnn/metafile.yml - configs/cascade_rpn/metafile.yml - configs/centernet/metafile.yml - configs/centripetalnet/metafile.yml - configs/cornernet/metafile.yml - configs/convnext/metafile...
2,401
31.459459
44
yml
mmdetection
mmdetection-master/setup.py
#!/usr/bin/env python # Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import platform import shutil import sys import warnings from setuptools import find_packages, setup import torch from torch.utils.cpp_extension import (BuildExtension, CppExtension, ...
7,887
34.692308
125
py
mmdetection
mmdetection-master/.circleci/config.yml
version: 2.1 # this allows you to use CircleCI's dynamic configuration feature setup: true # the path-filtering orb is required to continue a pipeline based on # the path of an updated fileset orbs: path-filtering: circleci/path-filtering@0.1.2 workflows: # the always-run workflow is always triggered, regardless...
1,275
35.457143
87
yml
mmdetection
mmdetection-master/.circleci/test.yml
version: 2.1 # the default pipeline parameters, which will be updated according to # the results of the path-filtering orb parameters: lint_only: type: boolean default: true jobs: lint: docker: - image: cimg/python:3.7.4 steps: - checkout - run: name: Install pre-comm...
6,158
31.415789
177
yml
mmdetection
mmdetection-master/.circleci/scripts/get_mmcv_var.sh
#!/bin/bash TORCH=$1 CUDA=$2 # 10.2 -> cu102 MMCV_CUDA="cu`echo ${CUDA} | tr -d '.'`" # MMCV only provides pre-compiled packages for torch 1.x.0 # which works for any subversions of torch 1.x. # We force the torch version to be 1.x.0 to ease package searching # and avoid unnecessary rebuild during MMCV's installatio...
574
27.75
66
sh
mmdetection
mmdetection-master/.dev_scripts/batch_test_list.py
# Copyright (c) OpenMMLab. All rights reserved. # yapf: disable atss = dict( config='configs/atss/atss_r50_fpn_1x_coco.py', checkpoint='atss_r50_fpn_1x_coco_20200209-985f7bd0.pth', eval='bbox', metric=dict(bbox_mAP=39.4), ) autoassign = dict( config='configs/autoassign/autoassign_r50_fpn_8x2_1x_coco...
12,707
34.3
117
py
mmdetection
mmdetection-master/.dev_scripts/benchmark_filter.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp def parse_args(): parser = argparse.ArgumentParser(description='Filter configs to train') parser.add_argument( '--basic-arch', action='store_true', help='to train models in basic arch') ...
7,106
41.303571
92
py
mmdetection
mmdetection-master/.dev_scripts/benchmark_inference_fps.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp import mmcv from mmcv import Config, DictAction from mmcv.runner import init_dist from terminaltables import GithubFlavoredMarkdownTable from tools.analysis_tools.benchmark import repeat_measure_inference_speed def parse...
6,764
38.561404
79
py
mmdetection
mmdetection-master/.dev_scripts/benchmark_test_image.py
# Copyright (c) OpenMMLab. All rights reserved. import logging import os.path as osp from argparse import ArgumentParser from mmcv import Config from mmdet.apis import inference_detector, init_detector, show_result_pyplot from mmdet.utils import get_root_logger def parse_args(): parser = ArgumentParser() pa...
3,674
34.679612
77
py
mmdetection
mmdetection-master/.dev_scripts/check_links.py
# Modified from: # https://github.com/allenai/allennlp/blob/main/scripts/check_links.py import argparse import logging import os import pathlib import re import sys from multiprocessing.dummy import Pool from typing import NamedTuple, Optional, Tuple import requests from mmcv.utils import get_logger def parse_args(...
5,049
30.962025
76
py
mmdetection
mmdetection-master/.dev_scripts/convert_test_benchmark_script.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp from mmcv import Config def parse_args(): parser = argparse.ArgumentParser( description='Convert benchmark model list to script') parser.add_argument('config', help='test config file path') parser.add_...
3,604
29.041667
79
py
mmdetection
mmdetection-master/.dev_scripts/convert_train_benchmark_script.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp def parse_args(): parser = argparse.ArgumentParser( description='Convert benchmark model json to script') parser.add_argument( 'txt_path', type=str, help='txt path output by benchmark_filter') p...
3,307
32.08
74
py
mmdetection
mmdetection-master/.dev_scripts/gather_models.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import glob import json import os.path as osp import shutil import subprocess from collections import OrderedDict import mmcv import torch import yaml def ordered_yaml_dump(data, stream=None, Dumper=yaml.SafeDumper, **kwds): class OrderedDumper(Dum...
12,487
35.408163
79
py
mmdetection
mmdetection-master/.dev_scripts/gather_test_benchmark_metric.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import glob import os.path as osp import mmcv from mmcv import Config def parse_args(): parser = argparse.ArgumentParser( description='Gather benchmarked models metric') parser.add_argument('config', help='test config file path') par...
3,916
39.381443
79
py
mmdetection
mmdetection-master/.dev_scripts/gather_train_benchmark_metric.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import glob import os.path as osp import mmcv from gather_models import get_final_results try: import xlrd except ImportError: xlrd = None try: import xlutils from xlutils.copy import copy except ImportError: xlutils = None def pars...
5,843
37.701987
79
py
mmdetection
mmdetection-master/.dev_scripts/linter.sh
yapf -r -i mmdet/ configs/ tests/ tools/ isort -rc mmdet/ configs/ tests/ tools/ flake8 .
90
21.75
40
sh
mmdetection
mmdetection-master/.dev_scripts/test_benchmark.sh
PARTITION=$1 CHECKPOINT_DIR=$2 echo 'configs/atss/atss_r50_fpn_1x_coco.py' & GPUS=8 GPUS_PER_NODE=8 CPUS_PER_TASK=2 tools/slurm_test.sh $PARTITION atss_r50_fpn_1x_coco configs/atss/atss_r50_fpn_1x_coco.py $CHECKPOINT_DIR/atss_r50_fpn_1x_coco_20200209-985f7bd0.pth --work-dir tools/batch_test/atss_r50_fpn_1x_coco --ev...
23,366
193.725
467
sh
mmdetection
mmdetection-master/.dev_scripts/test_init_backbone.py
# Copyright (c) OpenMMLab. All rights reserved. """Check out backbone whether successfully load pretrained checkpoint.""" import copy import os from os.path import dirname, exists, join import pytest from mmcv import Config, ProgressBar from mmcv.runner import _load_checkpoint from mmdet.models import build_detector ...
6,625
35.406593
78
py
mmdetection
mmdetection-master/.dev_scripts/train_benchmark.sh
echo 'configs/atss/atss_r50_fpn_1x_coco.py' & GPUS=8 GPUS_PER_NODE=8 CPUS_PER_TASK=2 ./tools/slurm_train.sh openmmlab atss_r50_fpn_1x_coco configs/atss/atss_r50_fpn_1x_coco.py ./tools/work_dir/atss_r50_fpn_1x_coco --cfg-options checkpoint_config.max_keep_ckpts=1 >/dev/null & echo 'configs/autoassign/autoassign_r50_fp...
22,182
163.318519
336
sh
mmdetection
mmdetection-master/.github/CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex ch...
3,355
42.584416
87
md
mmdetection
mmdetection-master/.github/CONTRIBUTING.md
We appreciate all contributions to improve MMDetection. Please refer to [CONTRIBUTING.md](https://github.com/open-mmlab/mmcv/blob/master/CONTRIBUTING.md) in MMCV for more details about the contributing guideline.
213
106
212
md
mmdetection
mmdetection-master/.github/pull_request_template.md
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. ## Motivation Please describe the motivation of this ...
1,310
49.423077
264
md
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/1-bug-report.yml
name: "🐞 Bug report" description: "Create a report to help us reproduce and fix the bug" labels: "kind/bug,status/unconfirmed" title: "[Bug] " body: - type: markdown attributes: value: | If you have already identified the reason, we strongly appreciate you creating a new PR to fix it [here](https:...
3,938
36.160377
200
yml
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/2-feature-request.yml
name: 🚀 Feature request description: Suggest an idea for this project labels: "kind/enhancement,status/unconfirmed" title: "[Feature] " body: - type: markdown attributes: value: | We strongly appreciate you creating a PR to implement this feature [here](https://github.com/open-mmlab/mmdetection/pu...
1,077
32.6875
131
yml
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/3-new-model.yml
name: "\U0001F31F New model/dataset/scheduler addition" description: Submit a proposal/request to implement a new model / dataset / scheduler labels: "kind/feature,status/unconfirmed" title: "[New Models] " body: - type: textarea id: description-request validations: required: true attributes: ...
1,084
31.878788
94
yml
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/4-documentation.yml
name: 📚 Documentation description: Report an issue related to the documentation. labels: "kind/doc,status/unconfirmed" title: "[Docs] " body: - type: dropdown id: branch attributes: label: Branch description: This issue is related to the options: - master branch https://mmdetection.readthedocs....
834
22.857143
68
yml
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/5-reimplementation.yml
name: "💥 Reimplementation Questions" description: "Ask about questions during model reimplementation" labels: "kind/enhancement,status/unconfirmed" title: "[Reimplementation] " body: - type: markdown attributes: value: | We strongly appreciate you creating a PR to implement this feature [here](htt...
4,281
46.577778
441
yml
mmdetection
mmdetection-master/.github/ISSUE_TEMPLATE/config.yml
blank_issues_enabled: true contact_links: - name: 💬 Forum url: https://github.com/open-mmlab/mmdetection/discussions about: Ask general usage questions and discuss with other MMDetection community members - name: 🌐 Explore OpenMMLab url: https://openmmlab.com/ about: Get know more about OpenMMLab...
319
31
91
yml
mmdetection
mmdetection-master/.github/workflows/build.yml
name: build on: push: paths-ignore: - ".dev_scripts/**" - ".github/**.md" - "demo/**" - "docker/**" - "tools/**" - "README.md" - "README_zh-CN.md" pull_request: paths-ignore: - ".dev_scripts/**" - ".github/**.md" - "demo/**" - "docker/**" ...
11,161
37.891986
166
yml
mmdetection
mmdetection-master/.github/workflows/build_pat.yml
name: build_pat on: push concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: build_parrots: runs-on: ubuntu-latest container: image: ghcr.io/zhouzaida/parrots-mmcv:1.3.4 credentials: username: zhouzaida p...
783
23.5
69
yml
mmdetection
mmdetection-master/.github/workflows/deploy.yml
name: deploy on: push concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: build-n-publish: runs-on: ubuntu-latest if: startsWith(github.event.ref, 'refs/tags') steps: - uses: actions/checkout@v2 - name: Set up Python...
765
22.9375
74
yml
mmdetection
mmdetection-master/.github/workflows/lint.yml
name: lint on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python 3.7 uses: actions/setup-python@v2 ...
761
23.580645
135
yml
mmdetection
mmdetection-master/.github/workflows/stale.yml
name: 'Close stale issues and PRs' on: schedule: # check issue and pull request once every day - cron: '25 11 * * *' permissions: contents: read jobs: invalid-stale-close: permissions: issues: write pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/stale@v...
1,598
48.96875
260
yml
mmdetection
mmdetection-master/.github/workflows/test_mim.yml
name: test-mim on: push: paths: - 'model-index.yml' - 'configs/**' pull_request: paths: - 'model-index.yml' - 'configs/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: build_cpu: runs-on: ubun...
1,293
24.372549
148
yml
mmdetection
mmdetection-master/configs/_base_/default_runtime.py
checkpoint_config = dict(interval=1) # yapf:disable log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook'), # dict(type='TensorboardLoggerHook') ]) # yapf:enable custom_hooks = [dict(type='NumClassCheckHook')] dist_params = dict(backend='nccl') log_level = 'INFO' load_from = No...
791
27.285714
67
py
mmdetection
mmdetection-master/configs/_base_/datasets/cityscapes_detection.py
# dataset settings dataset_type = 'CityscapesDataset' data_root = 'data/cityscapes/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict( type='Resize'...
1,937
33
79
py
mmdetection
mmdetection-master/configs/_base_/datasets/cityscapes_instance.py
# dataset settings dataset_type = 'CityscapesDataset' data_root = 'data/cityscapes/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict( ...
1,963
33.45614
79
py
mmdetection
mmdetection-master/configs/_base_/datasets/coco_detection.py
# dataset settings dataset_type = 'CocoDataset' data_root = 'data/coco/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='Resize', img_scale=(1333, 80...
1,711
33.24
77
py
mmdetection
mmdetection-master/configs/_base_/datasets/coco_instance.py
# dataset settings dataset_type = 'CocoDataset' data_root = 'data/coco/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict(type='Resize', img...
1,737
33.76
77
py
mmdetection
mmdetection-master/configs/_base_/datasets/coco_instance_semantic.py
# dataset settings dataset_type = 'CocoDataset' data_root = 'data/coco/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True), ...
1,922
33.963636
79
py
mmdetection
mmdetection-master/configs/_base_/datasets/coco_panoptic.py
# dataset settings dataset_type = 'CocoPanopticDataset' data_root = 'data/coco/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='LoadPanopticAnnotations', with_bbox=True, wit...
2,079
33.666667
79
py
mmdetection
mmdetection-master/configs/_base_/datasets/deepfashion.py
# dataset settings dataset_type = 'DeepFashionDataset' data_root = 'data/DeepFashion/In-shop/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), d...
1,888
33.981481
79
py
mmdetection
mmdetection-master/configs/_base_/datasets/lvis_v0.5_instance.py
# dataset settings _base_ = 'coco_instance.py' dataset_type = 'LVISV05Dataset' data_root = 'data/lvis_v0.5/' data = dict( samples_per_gpu=2, workers_per_gpu=2, train=dict( _delete_=True, type='ClassBalancedDataset', oversample_thr=1e-3, dataset=dict( type=dataset_...
786
30.48
68
py
mmdetection
mmdetection-master/configs/_base_/datasets/lvis_v1_instance.py
# dataset settings _base_ = 'coco_instance.py' dataset_type = 'LVISV1Dataset' data_root = 'data/lvis_v1/' data = dict( samples_per_gpu=2, workers_per_gpu=2, train=dict( _delete_=True, type='ClassBalancedDataset', oversample_thr=1e-3, dataset=dict( type=dataset_typ...
736
28.48
66
py
mmdetection
mmdetection-master/configs/_base_/datasets/objects365v1_detection.py
# dataset settings dataset_type = 'Objects365V1Dataset' data_root = 'data/Objects365/Obj365_v1/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='Resi...
1,714
33.3
77
py
mmdetection
mmdetection-master/configs/_base_/datasets/objects365v2_detection.py
# dataset settings dataset_type = 'Objects365V2Dataset' data_root = 'data/Objects365/Obj365_v2/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='Resi...
1,723
33.48
77
py