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
matscipy
matscipy-master/tests/test_eam_calculator_forces_and_hessian.py
# # Copyright 2020-2021 Lars Pastewka (U. Freiburg) # 2020 Jan Griesser (U. Freiburg) # 2019-2020 Wolfram G. Nöhring (U. Freiburg) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # This program is free software: you can redistribute it and/or...
9,568
39.205882
104
py
matscipy
matscipy-master/tests/test_committee.py
import os import re import copy import pathlib import pytest import numpy as np import ase.io import ase.calculators.emt import ase.calculators.lj import matscipy.calculators.committee @pytest.fixture def committeemember(): member = matscipy.calculators.committee.CommitteeMember(calculator=ase.calculators.emt.E...
9,666
42.940909
123
py
matscipy
matscipy-master/tests/test_crack.py
# # Copyright 2020 James Kermode (Warwick U.) # 2017, 2020 Lars Pastewka (U. Freiburg) # 2016 Punit Patel (Warwick U.) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # This program is free software: you can redistribute it and/or modify # it...
9,096
39.07489
127
py
matscipy
matscipy-master/tests/manybody/manybody_fixtures.py
"""Fixtures for Manybody potentials.""" import inspect import pytest import matscipy.calculators.manybody.potentials as potentials import numpy as np _classes = inspect.getmembers(potentials, inspect.isclass) _impl_potentials = { mother: [cls for _, cls in _classes if issubclass(cls, mother)] for mother in (p...
7,324
26.641509
84
py
matscipy
matscipy-master/tests/manybody/reference_params.py
Stillinger_Weber_PRB_31_5262_Si = { '__ref__': 'F. Stillinger and T. Weber, Phys. Rev. B 31, 5262 (1985)', 'el': 'Si', 'epsilon': 2.1683, 'sigma': 2.0951, 'costheta0': 0.333333333333, 'A': 7.049556277, 'B': 0.6022245584, 'p': 4, 'q': 0, 'a': 1.80, 'lambda1': 21.0, 'gamma'...
1,287
22
74
py
matscipy
matscipy-master/tests/manybody/test_manybody_potentials.py
"""Tests for implementation of potentials and derivatives.""" import pytest import numpy as np import numpy.testing as nt from types import SimpleNamespace from manybody_fixtures import ( pair_potential, three_body_potential, has_sympy, analytical_pair, analytical_triplet, FiniteDiff, ) def ...
3,254
26.584746
74
py
matscipy
matscipy-master/tests/manybody/test_newmb.py
# # Copyright 2022 Lucas Frérot (U. Freiburg) # 2022 Jan Griesser (U. Freiburg) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
14,624
27.017241
80
py
matscipy
matscipy-master/tests/manybody/test_manybody_molecules.py
# # Copyright 2022 Lucas Frérot (U. Freiburg) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Founda...
4,900
29.63125
78
py
matscipy
matscipy-master/tests/manybody/heterogeneous/polyphosphate.py
import pytest import numpy as np from ase.io import read from ase.optimize import FIRE from ase.calculators.mixing import SumCalculator from ase.calculators.calculator import PropertyNotImplementedError from matscipy.numerical import (numerical_forces, numerical_stress, numerical_nonaff...
6,260
27.589041
78
py
matscipy
matscipy-master/docs/conf.py
# -*- coding: utf-8 -*- # # matscipy documentation build configuration file, created by # sphinx-quickstart on Sun May 17 16:40:20 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
8,929
29.793103
83
py
DLBFoam-1.1_OF9
DLBFoam-1.1_OF9/tutorials/reactingFoam/shearlayer_DLB/solve_buffer.py
import matplotlib.pyplot as plt import numpy as np import glob import matplotlib fig,ax = plt.subplots() mean = 0 for rankid,rank in enumerate(sorted(glob.glob('processor*'))): get_problem = [] update_state = [] balance = [] solve_buffer = [] unbalance = [] time = [] cpu_solve = open(ra...
1,734
33.7
114
py
DLBFoam-1.1_OF9
DLBFoam-1.1_OF9/tutorials/reactingFoam/shearlayer_DLB_pyJac/solve_buffer.py
import matplotlib.pyplot as plt import numpy as np import glob import matplotlib fig,ax = plt.subplots() mean = 0 for rankid,rank in enumerate(sorted(glob.glob('processor*'))): get_problem = [] update_state = [] balance = [] solve_buffer = [] unbalance = [] time = [] cpu_solve = open(ra...
1,734
33.7
114
py
DLBFoam-1.1_OF9
DLBFoam-1.1_OF9/tests/validation/pyjacTests/PSRTest/computeReferenceValues.py
# Note: # - This python script computes reference results used in the OpenFOAM validation tests. # - Cantera environment must be created to run this python script. # - See https://cantera.org/index.html for further information # - The utilised mechanism is a modified GRI30 to achieve thermodynamic consistency with op...
1,669
32.4
106
py
EfficientDet
EfficientDet-master/inference.py
import cv2 import json import numpy as np import os import time import glob from model import efficientdet from utils import preprocess_image, postprocess_boxes from utils.draw_boxes import draw_boxes def main(): os.environ['CUDA_VISIBLE_DEVICES'] = '0' phi = 1 weighted_bifpn = True model_path = 'ef...
2,032
31.269841
105
py
EfficientDet
EfficientDet-master/inference_frozen_graph.py
import tensorflow as tf import numpy as np import cv2 import os import time from utils import preprocess_image from tensorflow.python.platform import gfile from utils.anchors import anchors_for_shape from utils.draw_boxes import draw_boxes from utils.post_process_boxes import post_process_boxes def get_frozen_graph(...
3,187
33.652174
109
py
EfficientDet
EfficientDet-master/initializers.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
1,177
27.731707
104
py
EfficientDet
EfficientDet-master/losses.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
7,520
39.005319
150
py
EfficientDet
EfficientDet-master/callbacks.py
from tensorflow.keras.callbacks import Callback import tensorflow.keras.backend as K import numpy as np class CosineAnnealingScheduler(Callback): def __init__(self, cycle_iterations, min_lr, t_mu=2, start_iteration=0): self.iteration_id = 0 self.start_iteration = start_iteration self.cycle...
2,830
36.746667
104
py
EfficientDet
EfficientDet-master/efficientnet.py
# Copyright 2019 The TensorFlow Authors, Pavel Yakubovskiy, Björn Barz. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
24,768
42.001736
109
py
EfficientDet
EfficientDet-master/setup.py
from distutils.core import setup from Cython.Build import cythonize import numpy setup( ext_modules=cythonize("utils/compute_overlap.pyx"), include_dirs=[numpy.get_include()] )
186
19.777778
55
py
EfficientDet
EfficientDet-master/model.py
from functools import reduce # from keras import layers # from keras import initializers # from keras import models # from keras_ import EfficientNetB0, EfficientNetB1, EfficientNetB2 # from keras_ import EfficientNetB3, EfficientNetB4, EfficientNetB5, EfficientNetB6 import tensorflow as tf from tensorflow.keras impo...
29,621
61.362105
125
py
EfficientDet
EfficientDet-master/layers.py
# import keras from tensorflow import keras import tensorflow as tf class BatchNormalization(keras.layers.BatchNormalization): """ Identical to keras.layers.BatchNormalization, but adds the option to freeze parameters. """ def __init__(self, freeze, *args, **kwargs): self.freeze = freeze ...
14,393
36.978892
135
py
EfficientDet
EfficientDet-master/inference_quad.py
from model import efficientdet import cv2 import os import numpy as np import time from utils import preprocess_image from utils.anchors import anchors_for_shape, AnchorParameters import os.path as osp os.environ['CUDA_VISIBLE_DEVICES'] = '0' phi = 3 weighted_bifpn = False model_path = 'checkpoints/2020-02-20/csv_02_...
5,103
44.981982
120
py
EfficientDet
EfficientDet-master/tfkeras.py
from utils import inject_tfkeras_modules, init_tfkeras_custom_objects import efficientnet as model EfficientNetB0 = inject_tfkeras_modules(model.EfficientNetB0) EfficientNetB1 = inject_tfkeras_modules(model.EfficientNetB1) EfficientNetB2 = inject_tfkeras_modules(model.EfficientNetB2) EfficientNetB3 = inject_tfkeras_mo...
694
42.4375
69
py
EfficientDet
EfficientDet-master/freeze_model.py
from model import efficientdet import cv2 import os import numpy as np import time from utils import preprocess_image import tensorflow as tf from tensorflow.keras import backend as K os.environ['CUDA_VISIBLE_DEVICES'] = '0' def freeze_session(session, keep_var_names=None, output_names=None, clear_devices=True): ...
2,011
38.45098
122
py
EfficientDet
EfficientDet-master/train.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
14,180
36.123037
120
py
EfficientDet
EfficientDet-master/inference_video.py
import cv2 import json import numpy as np import os import time import glob from model import efficientdet from utils import preprocess_image, postprocess_boxes from utils.draw_boxes import draw_boxes def main(): os.environ['CUDA_VISIBLE_DEVICES'] = '0' phi = 1 weighted_bifpn = True model_path = 'd1...
2,074
29.514706
105
py
EfficientDet
EfficientDet-master/keras_.py
from utils import inject_keras_modules, init_keras_custom_objects import efficientnet as model EfficientNetB0 = inject_keras_modules(model.EfficientNetB0) EfficientNetB1 = inject_keras_modules(model.EfficientNetB1) EfficientNetB2 = inject_keras_modules(model.EfficientNetB2) EfficientNetB3 = inject_keras_modules(model....
670
40.9375
65
py
EfficientDet
EfficientDet-master/generators/common.py
import numpy as np import random import warnings import cv2 from tensorflow import keras from utils.anchors import anchors_for_shape, anchor_targets_bbox, AnchorParameters class Generator(keras.utils.Sequence): """ Abstract generator class. """ def __init__( self, phi=0, ...
18,975
38.045267
145
py
EfficientDet
EfficientDet-master/generators/pascal.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
9,220
31.814947
120
py
EfficientDet
EfficientDet-master/generators/csv_.py
""" Copyright 2017-2018 yhenon (https://github.com/yhenon/) Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-...
13,347
36.389356
131
py
EfficientDet
EfficientDet-master/generators/__init__.py
0
0
0
py
EfficientDet
EfficientDet-master/generators/coco.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
5,710
34.253086
211
py
EfficientDet
EfficientDet-master/eval/common.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
11,199
35.842105
118
py
EfficientDet
EfficientDet-master/eval/pascal.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
3,989
36.641509
118
py
EfficientDet
EfficientDet-master/eval/__init__.py
0
0
0
py
EfficientDet
EfficientDet-master/eval/coco.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
7,327
37.772487
117
py
EfficientDet
EfficientDet-master/augmentor/color.py
import numpy as np from PIL import Image, ImageEnhance, ImageOps def autocontrast(image, prob=0.5): random_prob = np.random.uniform() if random_prob > prob: return image image = Image.fromarray(image[..., ::-1]) image = ImageOps.autocontrast(image) image = np.array(image)[..., ::-1] re...
5,921
32.083799
95
py
EfficientDet
EfficientDet-master/augmentor/transform.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
16,261
30.034351
137
py
EfficientDet
EfficientDet-master/augmentor/misc.py
import cv2 import numpy as np from augmentor.transform import translation_xy, change_transform_origin, scaling_xy from utils import reorder_vertexes def rotate(image, annotations, prob=0.5, border_value=(128, 128, 128)): assert 'bboxes' in annotations, 'annotations should contain bboxes even if it is empty' ...
11,766
43.57197
116
py
EfficientDet
EfficientDet-master/augmentor/__init__.py
0
0
0
py
EfficientDet
EfficientDet-master/utils/anchors.py
# import keras import numpy as np from tensorflow import keras from utils.compute_overlap import compute_overlap class AnchorParameters: """ The parameters that define how anchors are generated. Args sizes : List of sizes to use. Each size corresponds to one feature level. strides : List...
13,034
35.615169
119
py
EfficientDet
EfficientDet-master/utils/visualization.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
4,112
37.439252
136
py
EfficientDet
EfficientDet-master/utils/image.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
11,667
30.281501
137
py
EfficientDet
EfficientDet-master/utils/draw_boxes.py
import cv2 def draw_boxes(image, boxes, scores, labels, colors, classes): for b, l, s in zip(boxes, labels, scores): class_id = int(l) class_name = classes[class_id] xmin, ymin, xmax, ymax = list(map(int, b)) score = '{:.4f}'.format(s) color = colors[class_id] ...
712
38.611111
103
py
EfficientDet
EfficientDet-master/utils/transform.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
10,565
32.01875
117
py
EfficientDet
EfficientDet-master/utils/__init__.py
# Copyright 2019 The TensorFlow Authors, Pavel Yakubovskiy. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
5,843
30.934426
83
py
EfficientDet
EfficientDet-master/utils/colors.py
import warnings def label_color(label): """ Return a color from a set of predefined colors. Contains 80 colors in total. Args label: The label to get the color for. Returns A list of three values representing a RGB color. If no color is defined for a certain label, the color gre...
2,656
22.513274
115
py
MNC
MNC-master/tools/test_net.py
#!/usr/bin/env python # -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # ---------------------------------------...
2,755
31.423529
81
py
MNC
MNC-master/tools/_init_paths.py
import os.path import sys """ Add lib paths and caffe path to system search path """ def add_path(path): if path not in sys.path: sys.path.insert(0, path) cur_dir = os.path.dirname(__file__) # Add caffe python to PYTHONPATH caffe_path = os.path.join(cur_dir, '..', 'caffe-mnc', 'python') add_path(caffe...
417
17.173913
63
py
MNC
MNC-master/tools/demo.py
#!/usr/bin/python # -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------...
7,538
38.265625
93
py
MNC
MNC-master/tools/prepare_mcg_maskdb.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- # System modules import argparse import os import cPickle i...
11,222
42
118
py
MNC
MNC-master/tools/train_net.py
#!/usr/bin/env python # -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # ---------------------------------------...
3,331
32.656566
78
py
MNC
MNC-master/lib/mnc_config.py
"""MNC config system """ import numpy as np import os.path from easydict import EasyDict as edict __C = edict() cfg = __C # MNC/CFM mode __C.MNC_MODE = True __C.CFM_MODE = False __C.EXP_DIR = 'default' __C.USE_GPU_NMS = True __C.GPU_ID = 0 __C.RNG_SEED = 3 __C.EPS = 1e-14 __C.PIXEL_MEANS = np.array([[[102.9801, 115...
6,958
32.618357
91
py
MNC
MNC-master/lib/setup.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
6,247
36.413174
90
py
MNC
MNC-master/lib/db/roidb.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
6,862
37.55618
112
py
MNC
MNC-master/lib/db/imdb.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- from...
970
32.482759
88
py
MNC
MNC-master/lib/db/__init__.py
0
0
0
py
MNC
MNC-master/lib/db/maskdb.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- from mnc_config import cfg from db.imdb import get_imdb d...
1,162
29.605263
71
py
MNC
MNC-master/lib/datasets/pascal_voc.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
3,522
27.642276
77
py
MNC
MNC-master/lib/datasets/pascal_voc_det.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
13,855
42.435737
134
py
MNC
MNC-master/lib/datasets/__init__.py
0
0
0
py
MNC
MNC-master/lib/datasets/pascal_voc_seg.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import cPickle import os import scipy.io as sio import nump...
10,828
46.28821
116
py
MNC
MNC-master/lib/caffeWrapper/TesterWrapper.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
21,633
51.13012
123
py
MNC
MNC-master/lib/caffeWrapper/__init__.py
0
0
0
py
MNC
MNC-master/lib/caffeWrapper/SolverWrapper.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- imp...
6,147
43.230216
103
py
MNC
MNC-master/lib/pylayer/proposal_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
10,386
43.965368
121
py
MNC
MNC-master/lib/pylayer/mnc_data_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
5,826
37.589404
103
py
MNC
MNC-master/lib/pylayer/proposal_target_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
9,255
41.654378
97
py
MNC
MNC-master/lib/pylayer/mask_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import caffe import cv2 import numpy as np from transform.m...
3,988
37.728155
124
py
MNC
MNC-master/lib/pylayer/stage_bridge_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import caffe import numpy as np import yaml from transform....
11,685
44.648438
112
py
MNC
MNC-master/lib/pylayer/anchor_target_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
9,757
40.879828
94
py
MNC
MNC-master/lib/pylayer/cfm_data_layer.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import cv2 import yaml import scipy import numpy as np impo...
11,892
44.39313
122
py
MNC
MNC-master/lib/pylayer/__init__.py
0
0
0
py
MNC
MNC-master/lib/utils/timer.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
1,016
28.911765
77
py
MNC
MNC-master/lib/utils/voc_eval.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
13,824
34.088832
124
py
MNC
MNC-master/lib/utils/blob.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- """B...
3,732
33.564815
77
py
MNC
MNC-master/lib/utils/unmap.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
745
31.434783
77
py
MNC
MNC-master/lib/utils/__init__.py
0
0
0
py
MNC
MNC-master/lib/utils/vis_seg.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import numpy as np import cPickle import os import cv2 from...
5,842
38.47973
104
py
MNC
MNC-master/lib/transform/anchors.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
3,927
28.533835
78
py
MNC
MNC-master/lib/transform/bbox_transform.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
6,973
33.186275
97
py
MNC
MNC-master/lib/transform/__init__.py
0
0
0
py
MNC
MNC-master/lib/transform/mask_transform.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import numpy as np import cv2 from mnc_config import cfg fr...
11,105
37.696864
138
py
MNC
MNC-master/lib/nms/py_cpu_nms.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- impo...
1,118
27.692308
77
py
MNC
MNC-master/lib/nms/nms_wrapper.py
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- from...
2,332
31.402778
77
py
MNC
MNC-master/lib/nms/__init__.py
0
0
0
py
ContextsFair
ContextsFair-main/compute_results.py
import numpy as np # from collections import defaultdict if __name__ == '__main__': datasets = ['Yelp', 'Gowalla'] samplings = [100] models = ['GeoSoCa', 'LORE', 'CF', 'PFM'] top_n = [5, 10, 20] for dataset in datasets: for sampling in samplings: for model in models: ...
2,888
59.1875
209
py
flowseq
flowseq-master/flownmt/utils.py
import logging import sys from typing import Tuple, List import torch from torch._six import inf def get_logger(name, level=logging.INFO, handler=sys.stdout, formatter='%(asctime)s - %(name)s - %(levelname)s - %(message)s'): logger = logging.getLogger(name) logger.setLevel(logging.INFO) for...
7,058
30.513393
108
py
flowseq
flowseq-master/flownmt/flownmt.py
import os import json import math from typing import Dict, Tuple import torch import torch.nn as nn import torch.distributed as dist from apex.parallel import DistributedDataParallel from apex.parallel.distributed import flat_dist_call from flownmt.modules import Encoder from flownmt.modules import Posterior from flow...
29,121
44.432137
154
py
flowseq
flowseq-master/flownmt/__init__.py
from flownmt.flownmt import FlowNMT
37
11.666667
35
py
flowseq
flowseq-master/flownmt/modules/__init__.py
from flownmt.modules.encoders import * from flownmt.modules.posteriors import * from flownmt.modules.decoders import * from flownmt.modules.priors import *
156
30.4
40
py
flowseq
flowseq-master/flownmt/modules/decoders/simple.py
from overrides import overrides from typing import Dict, Tuple import torch import torch.nn as nn import torch.nn.functional as F from flownmt.modules.decoders.decoder import Decoder from flownmt.nnet.attention import GlobalAttention class SimpleDecoder(Decoder): """ Simple Decoder to predict translations fr...
3,347
33.875
138
py
flowseq
flowseq-master/flownmt/modules/decoders/transformer.py
from overrides import overrides from typing import Dict, Tuple import torch import torch.nn as nn import torch.nn.functional as F from flownmt.modules.decoders.decoder import Decoder from flownmt.nnet.attention import MultiHeadAttention from flownmt.nnet.transformer import TransformerDecoderLayer from flownmt.nnet.pos...
3,889
35.018519
138
py
flowseq
flowseq-master/flownmt/modules/decoders/decoder.py
from typing import Dict, Tuple import torch import torch.nn as nn from flownmt.nnet.criterion import LabelSmoothedCrossEntropyLoss class Decoder(nn.Module): """ Decoder to predict translations from latent z """ _registry = dict() def __init__(self, vocab_size, latent_dim, label_smoothing=0., _sh...
2,946
30.351064
138
py
flowseq
flowseq-master/flownmt/modules/decoders/__init__.py
from flownmt.modules.decoders.decoder import Decoder from flownmt.modules.decoders.simple import SimpleDecoder from flownmt.modules.decoders.rnn import RecurrentDecoder from flownmt.modules.decoders.transformer import TransformerDecoder
237
46.6
67
py
flowseq
flowseq-master/flownmt/modules/decoders/rnn.py
from overrides import overrides from typing import Dict, Tuple import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence from flownmt.modules.decoders.decoder import Decoder from flownmt.nnet.attention import GlobalAttention class Recu...
4,558
36.368852
138
py
flowseq
flowseq-master/flownmt/modules/priors/prior.py
import math from typing import Dict, Tuple, Union import torch import torch.nn as nn from flownmt.flows.nmt import NMTFlow from flownmt.modules.priors.length_predictors import LengthPredictor class Prior(nn.Module): """ class for Prior with a NMTFlow inside """ _registry = dict() def __init__(se...
9,219
41.293578
186
py
flowseq
flowseq-master/flownmt/modules/priors/__init__.py
from flownmt.modules.priors.prior import Prior from flownmt.modules.priors.length_predictors import *
102
33.333333
54
py
flowseq
flowseq-master/flownmt/modules/priors/length_predictors/diff_softmax.py
from overrides import overrides from typing import Dict, Tuple import torch import torch.nn as nn import torch.nn.functional as F from flownmt.modules.priors.length_predictors.predictor import LengthPredictor from flownmt.nnet.criterion import LabelSmoothedCrossEntropyLoss class DiffSoftMaxLengthPredictor(LengthPred...
4,818
38.178862
120
py