repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
synorim-merged
synorim-merged/pytorch/models/desc_net_self.py
from collections import defaultdict import numpy as np import torch from torch.utils.data import DataLoader from dataset.base import DatasetSpec as DS, list_collate from dataset.flow_dataset import FlowDataset from models.desc_net import Model as BaseModel class Model(BaseModel): """ Self-supervised setting...
4,150
48.416667
105
py
synorim-merged
synorim-merged/pytorch/models/basis_net.py
import random from collections import defaultdict import MinkowskiEngine as ME import torch import torch.nn.functional as F from torch.nn import Parameter from torch.utils.data import DataLoader from dataset.base import DatasetSpec as DS, list_collate from dataset.flow_dataset import FlowDataset, DataAugmentor from m...
19,450
48.874359
119
py
synorim-merged
synorim-merged/pytorch/models/spconv.py
import torch import torch.nn as nn import MinkowskiEngine as ME import MinkowskiEngine.MinkowskiFunctional as MEF class BasicBlockBase(nn.Module): """ A double-conv ResBlock with relu activation, with residual connection. """ def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, ...
4,471
38.22807
107
py
synorim-merged
synorim-merged/pytorch/utils/exp.py
import pickle import random from collections import OrderedDict import sys import numpy as np import torch import functools from pathlib import Path from omegaconf import OmegaConf def seed_everything(seed: int): """ Setup global seed to ensure reproducibility. :param seed: integer value """ rand...
5,232
32.120253
110
py
synorim-merged
synorim-merged/pytorch/utils/point.py
import torch def index_points_group(points, knn_idx, t=False): """ Input: points: input points data, [B, N', C], or [B, C, N'](transposed) knn_idx: sample index data, [B, N, K] Return: new_points:, indexed points data, [B, N, K, C] or [B, C, N, K](transposed) """ B, Np, C =...
2,010
34.280702
109
py
SSDUPplus
SSDUPplus-master/percent-distribution.py
import matplotlib.pyplot as plt import numpy as np f = open("con-stri.log",'r') x = list() percent = list() path = list() #path.append('b') i = 1 for line in f.readlines(): li = line.split(',') x.append(i) i = i+1 percent.append(float(li[0])) if int(li[1])==1: path.append('b') else: path.append('r') #path = p...
811
21.555556
46
py
SSDUPplus
SSDUPplus-master/test/automated/pvfs2tests.py
#!/usr/bin/python #NOTE:Command line takes 3 options: config file, PAV config, PAV machine list import os,sys,ConfigParser,bsddb,smtplib,string #This function gets all options from the Config file that was passed #at the command line. def getconfig(): Config=bsddb.hashopen(None,'w') Tests=bsddb.hashopen(None,'w')...
3,195
26.316239
108
py
SSDUPplus
SSDUPplus-master/maint/build/mpich2-build.py
#!/usr/bin/python # This script gets and builds MPICH2 with PVFS2 support import os,sys,string from optparse import OptionParser parser = OptionParser() parser.add_option("-v", "--cvstag", dest="cvs_tag", default="HEAD", help="pvfs2 cvs tag", metavar="TAG") parser.add_option("-r", "--dir", dest="rootdir", ...
3,415
30.925234
169
py
stylegan3
stylegan3-main/legacy.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
16,561
50.117284
154
py
stylegan3
stylegan3-main/gen_video.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
7,283
39.243094
190
py
stylegan3
stylegan3-main/visualizer.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
14,766
43.080597
160
py
stylegan3
stylegan3-main/avg_spectra.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
12,693
44.826715
146
py
stylegan3
stylegan3-main/gen_images.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
5,735
38.287671
144
py
stylegan3
stylegan3-main/dataset_tool.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
18,125
38.66302
162
py
stylegan3
stylegan3-main/train.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
15,910
54.055363
210
py
stylegan3
stylegan3-main/calc_metrics.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
8,114
41.936508
154
py
stylegan3
stylegan3-main/gui_utils/imgui_window.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,994
37.413462
114
py
stylegan3
stylegan3-main/gui_utils/text_utils.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
5,637
44.467742
143
py
stylegan3
stylegan3-main/gui_utils/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/gui_utils/glfw_window.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
7,848
33.126087
127
py
stylegan3
stylegan3-main/gui_utils/gl_utils.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
16,342
42.581333
162
py
stylegan3
stylegan3-main/gui_utils/imgui_utils.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
6,612
37.9
121
py
stylegan3
stylegan3-main/training/loss.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
7,999
55.737589
199
py
stylegan3
stylegan3-main/training/augment.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
26,617
59.910755
366
py
stylegan3
stylegan3-main/training/dataset.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
8,642
35.16318
158
py
stylegan3
stylegan3-main/training/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/training/training_loop.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
21,879
50.121495
168
py
stylegan3
stylegan3-main/training/networks_stylegan2.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
40,302
49.695597
164
py
stylegan3
stylegan3-main/training/networks_stylegan3.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
26,208
49.792636
141
py
stylegan3
stylegan3-main/torch_utils/custom_ops.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
6,646
41.06962
146
py
stylegan3
stylegan3-main/torch_utils/training_stats.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
10,720
38.855019
118
py
stylegan3
stylegan3-main/torch_utils/persistence.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
9,752
37.702381
144
py
stylegan3
stylegan3-main/torch_utils/misc.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
11,106
40.599251
133
py
stylegan3
stylegan3-main/torch_utils/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/torch_utils/ops/bias_act.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
9,845
45.885714
185
py
stylegan3
stylegan3-main/torch_utils/ops/grid_sample_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,575
40.103448
132
py
stylegan3
stylegan3-main/torch_utils/ops/conv2d_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
9,745
46.77451
197
py
stylegan3
stylegan3-main/torch_utils/ops/upfirdn2d.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
16,424
41.115385
120
py
stylegan3
stylegan3-main/torch_utils/ops/filtered_lrelu.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
12,916
45.970909
164
py
stylegan3
stylegan3-main/torch_utils/ops/conv2d_resample.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
6,765
45.986111
130
py
stylegan3
stylegan3-main/torch_utils/ops/fma.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
2,047
32.57377
105
py
stylegan3
stylegan3-main/torch_utils/ops/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/viz/renderer.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
15,309
39.502646
164
py
stylegan3
stylegan3-main/viz/layer_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
9,366
49.907609
193
py
stylegan3
stylegan3-main/viz/trunc_noise_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,791
48.894737
120
py
stylegan3
stylegan3-main/viz/capture_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,692
40.965909
133
py
stylegan3
stylegan3-main/viz/pickle_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
6,803
38.789474
121
py
stylegan3
stylegan3-main/viz/equivariance_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
5,822
49.198276
129
py
stylegan3
stylegan3-main/viz/latent_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,929
48.746835
155
py
stylegan3
stylegan3-main/viz/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/viz/performance_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,564
47.175676
130
py
stylegan3
stylegan3-main/viz/stylemix_widget.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,075
44.910448
146
py
stylegan3
stylegan3-main/metrics/metric_utils.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
11,936
41.632143
167
py
stylegan3
stylegan3-main/metrics/kernel_inception_distance.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
2,329
48.574468
133
py
stylegan3
stylegan3-main/metrics/frechet_inception_distance.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
2,067
48.238095
133
py
stylegan3
stylegan3-main/metrics/equivariance.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
10,868
39.55597
165
py
stylegan3
stylegan3-main/metrics/perceptual_path_length.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
5,256
40.722222
131
py
stylegan3
stylegan3-main/metrics/inception_score.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
1,901
47.769231
133
py
stylegan3
stylegan3-main/metrics/metric_main.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
5,675
35.857143
147
py
stylegan3
stylegan3-main/metrics/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
448
43.9
76
py
stylegan3
stylegan3-main/metrics/precision_recall.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
3,644
56.857143
159
py
stylegan3
stylegan3-main/dnnlib/util.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
17,132
33.823171
151
py
stylegan3
stylegan3-main/dnnlib/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
488
47.9
76
py
DDrates
DDrates-master/src/DM_MigdalEffect.py
######################### # # # Migdal Effect # # # ######################### ################ # Explanations # ################ #This program contains the DM rate exploiting the Migdal Effect for Ar detectors, #formulae from 1707.07258 and 1711.09906. ##########...
4,454
27.557692
88
py
DDrates
DDrates-master/src/DM_LAr.py
##################################### # # # DarkSide useful functions # # # ##################################### ################ # Explanations # ################ #This program contains some useful functions for analyses of LAr experiment...
2,912
25.243243
99
py
DDrates
DDrates-master/src/halo_models.py
####################### # # # Halo models # # # ####################### ################ # Explanations # ################ #This program contains the Standard Halo Model ########## # Import # ########## #This part of the code imports the necessary Python libraries....
1,836
23.171053
85
py
DDrates
DDrates-master/src/DM_NR.py
############################################## # # # Nuclear recoil functions (only SI) # # # ############################################## ################ # Explanations # ################ #This program contains the DM ...
3,505
26.178295
91
py
DDrates
DDrates-master/src/DM_bremsstrahlung.py
######################### # # # Brehmstrahlung # # # ######################### ################ # Explanations # ################ #This program contains the DM rate exploiting the elastic nuclear recoil detected by bremsstrahlung, #see [arxiv:1607.01789v2] #######...
3,755
25.083333
100
py
pyladies
pyladies-main/test_www.py
#!/usr/bin/env python import os def simple_test(): here = os.path.dirname(os.path.realpath(__file__)) www = os.path.join(here, "www") assert os.path.exists(www) if __name__ == "__main__": simple_test() print("Test passed. www directory exists.")
273
15.117647
54
py
MaskTextSpotter
MaskTextSpotter-master/setup.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. #!/usr/bin/env python import glob import os import torch from setuptools import find_packages from setuptools import setup from torch.utils.cpp_extension import CUDA_HOME from torch.utils.cpp_extension import CppExtension from torch.utils.cpp_ext...
2,055
28.371429
73
py
MaskTextSpotter
MaskTextSpotter-master/tools/test_net.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Set up custom environment before nearly anything else is imported # NOTE: this should be the first import (no not reorder) from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:skip import argparse import os import torch...
3,340
33.802083
88
py
MaskTextSpotter
MaskTextSpotter-master/tools/demo.py
import os import cv2 import torch from torchvision import transforms as T from maskrcnn_benchmark.modeling.detector import build_detection_model from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer from maskrcnn_benchmark.structures.image_list import to_image_list from maskrcnn_benchmark.config import...
9,596
39.154812
123
py
MaskTextSpotter
MaskTextSpotter-master/tools/train_net.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. r""" Basic training script for PyTorch """ # Set up custom environment before nearly anything else is imported # NOTE: this should be the first import (no not reorder) from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:s...
5,444
30.293103
89
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/solver/lr_scheduler.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from bisect import bisect_right import torch # FIXME ideally this would be achieved with a CombinedLRScheduler, # separating MultiStepLR with WarmupLR # but the current LRScheduler design doesn't allow it class WarmupMultiStepLR(torch.optim.lr_s...
1,810
33.169811
80
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/solver/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from .build import make_optimizer from .build import make_lr_scheduler from .lr_scheduler import WarmupMultiStepLR
187
36.6
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/solver/build.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from .lr_scheduler import WarmupMultiStepLR def make_optimizer(cfg, model): params = [] for key, value in model.named_parameters(): if not value.requires_grad: continue lr = cfg.SOLVER.BASE_LR ...
1,083
29.111111
79
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/config/defaults.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import os from yacs.config import CfgNode as CN # ----------------------------------------------------------------------------- # Convention about Training / Test specific parameters # ------------------------------------------------------------...
11,615
37.979866
83
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/config/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from .defaults import _C as cfg
104
34
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/config/paths_catalog.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Centralized catalog of paths.""" import os def add_gt_path(data_dir, attrs): if len(attrs)>1: return os.path.join(data_dir,attrs[1]) else: return None class DatasetCatalog(object): DATA_DIR = "datasets" DATASE...
8,907
36.745763
121
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/nms.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # from ._utils import _C from maskrcnn_benchmark import _C nms = _C.nms # nms.__doc__ = """ # This function performs Non-maximum suppresion"""
216
26.125
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/batch_norm.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch import nn class FrozenBatchNorm2d(nn.Module): """ BatchNorm2d where the batch statistics and the affine parameters are fixed """ def __init__(self, n): super(FrozenBatchNorm2d, self).__init__()...
799
31
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/roi_pool.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from maskrcnn_benchmark import _C class _ROIPool(Function): @staticmethod ...
1,855
28
74
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/roi_align.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from maskrcnn_benchmark import _C class _ROIAlign(Function): @staticmethod...
2,110
29.594203
85
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/smooth_l1_loss.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch # TODO maybe push this to nn? def smooth_l1_loss(input, target, beta=1. / 9, size_average=True): """ very similar to the smooth_l1_loss from pytorch, but with the extra beta parameter """ n = torch.abs(input - tar...
481
27.352941
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/_utils.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import glob import os.path import torch try: from torch.utils.cpp_extension import load as load_ext from torch.utils.cpp_extension import CUDA_HOME except ImportError: raise ImportError("The cpp layer extensions requires PyTorch 0.4 o...
1,165
28.15
80
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/misc.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """ helper class that supports empty tensors on some nn functions. Ideally, add support directly in PyTorch to empty tensors in those functions. This can be removed once https://github.com/pytorch/pytorch/issues/12013 is implemented """ import m...
3,241
30.475728
88
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/layers/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from .batch_norm import FrozenBatchNorm2d from .misc import Conv2d from .misc import ConvTranspose2d from .misc import interpolate from .nms import nms from .roi_align import ROIAlign from .roi_align import roi_align from .roi_pool im...
557
33.875
148
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/engine/inference.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import logging import tempfile import time import os from collections import OrderedDict import torch from tqdm import tqdm from ..structures.bounding_box import BoxList from ..utils.comm import is_main_process from ..utils.comm ...
14,699
33.265734
88
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/engine/text_inference.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import logging import tempfile import time import os from collections import OrderedDict import torch from tqdm import tqdm from ..structures.bounding_box import BoxList from ..utils.comm import is_main_process from ..utils.comm ...
15,120
36.992462
203
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/engine/trainer.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import logging import time import torch import torch.distributed as dist from maskrcnn_benchmark.utils.comm import get_world_size, is_main_process from maskrcnn_benchmark.utils.metric_logger import MetricLogger def reduce_loss_di...
4,044
32.991597
79
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/c2_model_loading.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import pickle from collections import OrderedDict import torch from maskrcnn_benchmark.utils.model_serialization import load_state_dict def _rename_basic_resnet_weights(layer_keys): layer_keys = [k.replace("_", ".") for k in ...
5,667
38.636364
129
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/metric_logger.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from collections import defaultdict from collections import deque import torch class SmoothedValue(object): """Track a series of values and provide access to smoothed values over a window or the global series average. """ def __...
1,714
25.796875
82
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/checkpoint.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import os import torch from maskrcnn_benchmark.utils.model_serialization import load_state_dict from maskrcnn_benchmark.utils.c2_model_loading import load_c2_format from maskrcnn_benchmark.utils.imports import import_file from mask...
4,813
33.385714
87
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/comm.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """ This file contains primitives for multi-gpu communication. This is useful when doing distributed training. """ import os import pickle import tempfile import time import torch import torch.distributed as dist def get_world_size(): if no...
4,514
29.714286
80
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/model_zoo.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import os import sys try: from torch.hub import _download_url_to_file from torch.hub import urlparse from torch.hub import HASH_REGEX except ImportError: from torch.utils.model_zoo import _download_url_to_file from torch.utils....
3,045
48.129032
135
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/logging.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # modified by Minghui Liao import logging import os import sys from tensorboardX import SummaryWriter def setup_logger(name, save_dir, distributed_rank=0): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG) # don't log r...
1,279
28.767442
84
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/collect_env.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import PIL from torch.utils.collect_env import get_pretty_env_info def get_pil_version(): return "\n Pillow ({})".format(PIL.__version__) def collect_env_info(): env_str = get_pretty_env_info() env_str += get_pil_version() ...
338
21.6
71
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/model_serialization.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from collections import OrderedDict import logging import torch from maskrcnn_benchmark.utils.imports import import_file def align_and_update_state_dicts(model_state_dict, loaded_state_dict): """ Strategy: suppose that the models that w...
3,464
41.777778
91
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/chars.py
import os import numpy as np import cv2 def char2num(char): if char in '0123456789': num = ord(char) - ord('0') + 1 elif char in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ': num = ord(char.lower()) - ord('a') + 11 else: num = 0 return num def num2char(num): chars = '_0123456789abcdefghijklmnopqr...
4,288
26.318471
100
py
MaskTextSpotter
MaskTextSpotter-master/maskrcnn_benchmark/utils/__init__.py
0
0
0
py