text
string
import os import torch import numpy as np import scipy.ndimage as nd from embryovision.util import ( load_and_crop_image, augment_focus, sort_azimuthally) from embryovision.localfolders import embryovision_folder from embryovision.predictor import Predictor, load_maskrcnn from embryovision.managedata impo...
<gh_stars>1-10 #!/usr/bin/env python3 from argparse import ArgumentParser import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' parser = ArgumentParser() parser.add_argument("mode") parser.add_argument("image_path") parser.add_argument("stats_path") parser.add_argument("model_path") parser.add_argument("output_file") p...
''' Header reading functions for SPM version of analyze format ''' import warnings import numpy as np from nifti.volumeutils import HeaderDataError, HeaderTypeError, \ allopen from nifti import filetuples # module import from nifti.batteryrunners import Report from nifti import analyze # module import ''' Suppor...
import os import h5py import matplotlib.pyplot as plt from pathlib import Path from time import time, strftime import pandas as pd import numpy as np import scipy.ndimage as ndi import argparse from rabbitccs.data.utilities import load, save, print_orthogonal from rabbitccs.inference.thickness_analysis import _local_...
<reponame>yjzhang2013/pancanatlas_code_public<filename>alt_splice/outliers/sf_utils.py import os import sys import h5py import numpy as np import scipy as sp import pandas as pd def run_preproc_tests(psi, psi_is_fin=None): '''Prints a table showing how many rows/cols left at each thold. ''' if psi_is_fin i...
<gh_stars>1-10 import os import pickle import scipy.stats as stats import MixtureOfExperts from MixtureOfExperts.utils import simulate_data as sd import matplotlib.pyplot as plt import numpy as np import logging def true_density(xbins, ybins, mu1, mu2, tau1, tau2, coef1, coef2, factor1, factor2, noise): """ Ge...
<reponame>maierbn/opendihu #! /usr/bin/python3 # Plot the fiber to MU assignment that is given in a file, e.g. MU_fibre_distribution_37x37_10.txt # usage: ./plot_fiber_distribution <filename> # import sys import random import time import numpy as np import scipy import scipy.integrate import scipy.signal import matplo...
<reponame>deepankur797/random import numpy as np import pandas as pd import matplotlib.pyplot as plt #%matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) import seaborn as sns from scipy import stats from scipy.stats import norm train = pd.read_csv("D:\\cygwin\\COLLEGE STUFF(A)\\8th sem\\major 2\\...
<gh_stars>1-10 # !/usr/bin/env python # -*- coding:utf-8 _*- # @Author: swang # @Contact: <EMAIL> # @Project Name: keyword_spotting_system # @File: test.py # @Time: 2021/11/11/21:51 # @Software: PyCharm import os, sys CRT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(CRT_DIR) # print('sys.path:', sy...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.sparse import csr_matrix, hstack from sklearn import decomposition from sklearn.preprocessing import StandardScaler from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import Str...
# Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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 a...
<filename>pymixconsole/processors/convreverb.py FFT_TYPE = "scipy" import os import pathlib import warnings import numpy as np import scipy.signal from scipy.io import wavfile from ..parameter import Parameter from ..processor import Processor from ..parameter_list import ParameterList if FFT_TYPE == "scipy": f...
import matplotlib #matplotlib.use("agg") #matplotlib.use("tkagg") import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import importlib as imp import numpy as np import os from scipy import ndimage import torch import torch.nn as nn import torch.nn.functional as F import torch.autograd as autograd i...
# -*- coding: utf-8 -*- import os import time from datetime import datetime import logging from scipy.sparse import lil_matrix from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squar...
''' Copyright (c) 2018 <NAME>, Rutgers University http://www.cs.rutgers.edu/~hxp1/ This code is free to use for academic/research purpose. ''' import numpy as np import cntk as C import cv2 from scipy.signal import medfilt import time import ShapeUtils2 as SU from SysUtils import make_dir, get_items, get_current_ti...
<gh_stars>1-10 #Import required packages from pycc.rt.utils import FWHM from scipy.fft import fft import numpy as np import pytest def test_FWHM(): #Define function np.random.seed(10) timestep = 0.001 t = np.arange(0, 1, timestep) f = np.cos(2*np.pi*12*t) + np.sin(2*np.pi*50*t) f = f + np.rando...
"""Evaluation metrics.""" import numpy as np import pdb import time import warnings import os import re import copy import itertools from dcCustom.metrics.cindex_measure import cindex from multiprocessing import Pool from time import gmtime, strftime from deepchem.utils.save import log from sklearn.metrics import roc_...
from glob import glob from math import exp from os import path from typing import List, Dict import cv2 import numpy as np import skimage.measure from scipy.optimize import linear_sum_assignment detection = '' ground_truth = '' def get_region_props(image: np.ndarray) -> List[skimage.measure._regionprops._RegionProp...
<reponame>BUAA-BDA/FedShapley<gh_stars>10-100 from __future__ import absolute_import, division, print_function import tensorflow_federated as tff import tensorflow.compat.v1 as tf import numpy as np import time from scipy.special import comb, perm import os # tf.compat.v1.enable_v2_behavior() # tf.compat.v1...
<filename>summary_consumer.py<gh_stars>0 from kafka import KafkaConsumer from json import loads from sqlalchemy import create_engine import statistics if __name__ == "__main__": engine = create_engine('sqlite:///bank.db', echo = True) db = engine.connect() consumer = KafkaConsumer('transactions', ...
<gh_stars>0 #! /usr/bin/env python from math import sqrt from sympy import sieve import time def count_squarefree(N): '''Return the number of squarefree integers below N.''' mobius = [1] * int(sqrt(N)) for p in sieve.primerange(2, int(sqrt(N))): for i in xrange(p, int(sqrt(N)), p): mobius[i-1] = -mob...
<gh_stars>0 import requests from scipy.io import wavfile from scipy import signal import numpy as np import matplotlib.pyplot as plt # fileName = "1-103995-A-30.wav" fileName = "1-100038-A-14.wav" response = requests.get(f"https://github.com/karolpiczak/ESC-50/raw/master/audio/{fileName}") with open(fileName, "wb") ...
import os import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.stats import beta from bayes_cv_prune.StanModel import BayesStanPruner """Plot the second 3 graphs in section 2.3: The prior. """ def plot(): CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) # Final mode...
<filename>ibench/benchmarks/qr.py # Copyright (C) 2016-2017 Intel Corporation # # SPDX-License-Identifier: MIT import numpy as np import scipy from .bench import Bench class Qr(Bench): sizes = {'large': 10000, 'small': 5000, 'tiny': 1000, 'test': 2} def _ops(self, n): return (4./3.)*n*n*n*1e-9 ...
#!/usr/bin/env python # Copyright 2019 Calico LLC # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agr...
<reponame>laekov/akg<filename>tests/common/test_run/distr_normal_diag_logprob_run.py # Copyright 2019 Huawei Technologies Co., Ltd # # 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://w...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 2 15:23:46 2020 Copyright 2020 by <NAME>. """ # %% Imports. # Standard library import: from math import pi from matplotlib import cm import matplotlib.pyplot as plt import numpy as np from scipy.sparse import csc_matrix, eye, kron f...
""" This file is for preprocessing of dataset. Dataset: Avenue Original dataset distribution link: http://www.cse.cuhk.edu.hk/leojia/projects/detectabnormal/dataset.html """ import os import cv2 import glob pwd = os.getcwd() DATASET_NAME = 'avenue' def download_dataset(delete_archive=False): os.chdir(os.path.join...
<filename>source/banco/bd_sensores.py # -*- coding: latin-1 -*- import sqlite3, scipy, datetime def cria_tabela(caminho_banco): ''' Cira a tabela 'dados_forno' caso ela não exista, criando o esquema e as colunas no formato correto. O nome do arquivo do banco de dados é caminho_banco e esta na mesma pasta /bandoDad...
import numpy as np from numpy.random import randn import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import DataFrame, Series, isna, notna import pandas._testing as tm import pandas.tseries.offsets as offsets def _check_moment_func( static_comp, name, raw, has_m...
import numpy as np from scipy.signal import savgol_filter from scipy.interpolate import interp1d class Lane(object): """ Utility class for extracting useful properties of a lane. It is assumed that there is a one-to-one mapping between the x- and y-coordinates. Parameters: x: array Array...
<filename>lifetime_value/zero_inflated_lognormal_test.py # Copyright 2019 The Lifetime Value Authors. # # 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 # # https://www.apache.org/licenses/L...
# -*- coding:utf-8 _*- """ @author:yaoli @file: label2rgb.py.py @time: 2019/01/22 Test change one_chanel label to 3 channel RGB image. """ import os import numpy as np import scipy.misc from tqdm import tqdm def annotation2color(input_path, output_path): img = scipy.misc.imread(input_path) color = np.zero...
<reponame>Hephaestus12/applications import pandas as pd import shogun as sg from pathlib import Path import matplotlib.pyplot as plt from scipy import stats
<filename>camFingerprint.py import numpy as np #from matplotlib.image import imread,imsave import cv2 import pywt import matplotlib.pyplot as plt import sys from numba import jit,njit from scipy.signal import correlate2d def matshow(title,mat): mat = mat.astype(float) mi = np.min(mat) ma = np.m...
# -*- coding: utf-8 -*- from __future__ import print_function from collections import OrderedDict from acq4.util import Qt from .CanvasItem import CanvasItem import numpy as np import scipy.ndimage as ndimage import acq4.pyqtgraph as pg import acq4.pyqtgraph.flowchart import acq4.util.DataManager as DataManager import ...
import importlib from hydroDL import kPath, utils from hydroDL.app import waterQuality from hydroDL.master import basins from hydroDL.data import usgs, gageII, gridMET, ntn from hydroDL.master import slurm from hydroDL.post import axplot, figplot import numpy as np import matplotlib.pyplot as plt import os import panda...
<reponame>subercui/velocyto.py import numpy as np from numba import jit from sklearn.neighbors import kneighbors_graph, NearestNeighbors from scipy import sparse import logging from typing import * # Mutual KNN functions @jit(signature_or_function="Tuple((float64[:,:], int64[:,:], int64[:]))(int64[:,:], float64[:, :...
import pandas as pd import numpy as np from pandas.tseries.offsets import * import scipy.optimize as opt import scipy.cluster.hierarchy as sch from scipy import stats class FHBacktestAncilliaryFunctions(object): """ This class contains a set of ancilliary supporting functions for performing backtests. The...
import os import numpy import scipy.integrate def AB(wave, flambda, AB_wave): """Returns the AB magnitude at `AB_wave` (nm) of spectrum specified by `wave` (in nm), and `flambda` (in erg/s/cm^2/Ang). """ speed_of_light = 2.99792458e18 # units are Angstrom Hz fNu = flambda * (wave * 10)**2 / speed_...
"""Convert MATLAB data file into Spectre txt format divik2spectre.py Converts MATLAB data file into Spectre txt format Copyright 2017 Spectre Team 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 23 11:41:26 2019 @author: roshanprakash """ import time import numpy as np import tensorflow as tf from scipy.stats import ttest_ind from sklearn.tree import DecisionTreeRegressor as DT from sklearn.preprocessing import scale from sklearn.model_sele...
import cv2 import numpy as np import os import math from scipy.spatial import distance as dist from collections import OrderedDict lower_green = np.array([89, 250, 250]) upper_green = np.array([90, 255, 255]) lower_rgb = np.array([10,180,120]) upper_rgb = np.array([40,255,250]) class Bouncing_point(): def __in...
""" Classes and tools to easily set up a FEM model made of beam elements References: [2] <NAME>, <NAME> "Dynamik Flexibler Mehrkoerpersysteme : Methoden Der Mechanik """ import pandas as pd import numpy as np import scipy from welib.FEM.utils import skew from welib.system.eva import eig # ----------...
<filename>multiframe_star/database/genDB_old.py import numpy as np import h5py import scipy.io as io import poppy import sys import scipy.special as sp import pyfftw from astropy import units as u import matplotlib.pyplot as pl from ipdb import set_trace as stop def even(x): return x%2 == 0 def zernike_parity(j, ...
import math import matplotlib.pyplot as plt from prettytable import PrettyTable from sympy import * import numpy as np x = symbols('x') #Raízes de Equações ##Método da Bissecção def plot2d(f, inicio, fim): z = np.arange(inicio,fim,0.1) y = [] for i in range(len(z)): y.append(f.subs(x,z[i])) ...
<reponame>flowerah/PythoMS """ IGNORE: CHANGELOG: - ---2.7 building to add: try to extract timepoints and tic from chromatogramList (x values are sorted, so this probably won't work) IGNORE """ import sys import os import zlib import gzip import base64 import struct import subprocess import xml.dom.minidom import ...
<gh_stars>1-10 from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple from numpy import ndarray from collections import OrderedDict from scipy import sparse import os import sklearn import numpy import typing # Custom import commands if any import warnings import numpy as np from sklearn.utils ...
<filename>mvsnet/preprocess.py #!/usr/bin/env python """ Copyright 2019, <NAME>, HKUST. Training preprocesses. """ from __future__ import print_function import os import time import glob import random import math import re import sys import imageio import cv2 import numpy as np import tensorflow as tf import scipy.i...
#!/bin/env python3 # This class will perform fisher's exact test to evalutate the significance of connection between # a list of source nodes with certain qnode_id in KG and each of the target nodes with specified type. # relative imports import scipy.stats as stats import traceback import sys import os import multipr...
<reponame>oo92/Deep3dPortrait<filename>restore_from_crop.py import os import numpy as np import cv2 from scipy.io import loadmat def realign(img, crop_param, raw_w, raw_h, interpolation, crop_h=256, crop_w=256): scale = crop_param[0] left, up = int(crop_param[1]), int(crop_param[2]) canvas = np.zeros([4 ...
<reponame>wei-mao-2019/gsps import numpy as np import argparse import os import sys import pickle import csv from scipy.spatial.distance import pdist sys.path.append(os.getcwd()) from utils import * from motion_pred.utils.config import Config from motion_pred.utils.dataset_h36m import DatasetH36M from motion_pred.util...
<reponame>simpeg-research/iris-mt-scratch """ follows Gary's TRegression.m in iris_mt_scratch/egbert_codes-20210121T193218Z-001/egbert_codes/matlabPrototype_10-13-20/TF/classes There are some high-level decisions to make about usage of xarray.Dataset, xarray.DataArray and numpy arrays. For now I am going to cast X,Y...
<filename>userlib/analysislib/paco_analysis/imageprocss/analyse.py from __future__ import division import numpy as np from os import listdir from os.path import isfile, join import h5py import matplotlib.pyplot as plt from scipy.linalg import pinv, lu, solve from sklearn.linear_model import Lasso plt.clf() __author__ ...
import numpy as np from scipy.optimize import minimize import libSolver class Species: def __init__(self, charge, mass, density, vpara, vperp, fv, ns): """Constructs a species object with the required fields. """ assert(vpara.shape[0] == fv.shape[0]) assert(vperp.shape[0] == fv.shape[1]) ...
"""Evaluation routines for point spread functions.""" import numbers from prysm.fttools import fftrange from scipy import optimize from .mathops import ( np, jinc, ndimage, special ) from .coordinates import uniform_cart_to_polar FIRST_AIRY_ZERO = 1.220 SECOND_AIRY_ZERO = 2.233 THIRD_AIRY_ZERO = 3.238 F...
#----------------------------------------------------------------------------------- #----------------------------------------------------------------------------------- #-------------------------------B-SPLINE EXAMPLE CODE------------------------------- #----------------------------------------------------------------...
<gh_stars>0 #! /usr/bin/env python ############################################################################# # Created in 2013 by <NAME> and <NAME>, USGS Rocky Mountain # Geographic Science Center # Created Python script to loop through all the individual burn probability # (BP) images and then create a burne...
<reponame>minrk/sympy<gh_stars>1-10 from sympy.core import S, C, sympify from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.operations import LatticeOp, ShortCircuit from sympy.core.function import Application, Lambda from sympy.core.expr import Expr from sympy.core.singleton imp...
""" This code performs Reversible Jump Markov Chain Monte Carlo for the Lennard-Jones fluid. The target property is heat of vaporization, which only depends on epsilon. Therefore, the expected outcome is that RJMC favors the single parameter model (just epsilon) over the two parameter model (both ...
import os import re import glob import fire import pickle import numpy as np import pandas as pd import matplotlib.patches as patches import matplotlib.pyplot as plt from sklearn.neighbors import KDTree from scipy.special import digamma import warnings warnings.filterwarnings('error') fields = 'a0_sym,a0_stct,a0_scor...
<filename>P4.py #!/usr/bin/env python3 # Copyright (C) 2021 <NAME>. # SPDX-License-Identifier: MIT from PIL import Image from scipy.fft import fft import numpy as np import matplotlib.pyplot as plt import time def fuente_info(imagen): '''Una función que simula una fuente de información al importar una image...
<filename>perceptual_loss.py<gh_stars>10-100 from __future__ import absolute_import import sys import scipy import scipy.misc import numpy as np import torch from torch.autograd import Variable import models use_gpu = True ref_path = './imgs/ex_ref.png' pred_path = './imgs/ex_p1.png' ref_img = scipy.misc.imread(r...
<gh_stars>0 from sklearn.neighbors import KNeighborsClassifier from deepview.embeddings import init_inv_umap import scipy.spatial.distance as distan import numpy as np import umap def leave_one_out_knn_dist_err(dists, labs, n_neighbors=5): nn = KNeighborsClassifier(n_neighbors=5, metric="precomputed") nn.fit(d...
<filename>scripts/tip-post-processing.py import numpy as np import matplotlib.pyplot as plt from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvas from scipy.ndimage import gaussian_filter # First pass for drop-shadow fig = Figure(figsize=(6,1.5)) canvas = FigureCanvas(fig) ax = ...
<reponame>trentford/iem<filename>scripts/iemre/grid_climate_prism.py """Grid climate for netcdf usage""" from __future__ import print_function import sys import datetime import numpy as np import psycopg2.extras from scipy.interpolate import NearestNDInterpolator from pyiem import iemre, datatypes from pyiem.network i...
__author__ = '<NAME>' # Copyright <NAME> 2015 import math import numpy as np from scipy.interpolate import interp1d import matplotlib.pyplot as plt from ContourPoint import ContourPoint contourPointsFile = 'contours2D.csv' with open(contourPointsFile, "rt") as fin: # split the first line line = fin.readline...
<reponame>deepdialog/PanGu-alpha-tf import os import jieba import numpy as np from scipy.special import softmax from onnxruntime import GraphOptimizationLevel, InferenceSession, SessionOptions, get_all_providers from tokenization_jieba import JIEBATokenizer def create_model_for_provider(model_path: str, provider: st...
<reponame>m4webb/numerical_computing<filename>Labs/IsingModel/plots.py import matplotlib matplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc') import isingmodel import scipy.misc as spmisc import matplotlib.pyplot as plt def initialize(): spinconfig = isingmodel.initialize(100) spmisc.ims...
<reponame>visten92/CAE-FFNN import tensorflow as tf import numpy as np import scipy.io from matplotlib import pyplot as plt import time # Load data and set hyperparameters data_1 = scipy.io.loadmat('data_train_batch_1.mat') data_2 = scipy.io.loadmat('data_train_batch_2.mat') data_3 = scipy.io.loadmat('data_tr...
<reponame>bolero2/DeepLearning-dc import numpy as np import matplotlib,pylab as plt import scipy.io matfile_name = "C:\\dataset\\mpii_human_pose_v1_u12_2\\mpii_human_pose_v1_u12_1.mat" matfile = scipy.io.loadmat(matfile_name, struct_as_record=False) print(matfile.get('RELEASE')[0, 0].get('annolist')) # print(ma...
""" This script generates data used to estimate spar mass as a function of lift force (i.e. total weight) and span. """ ### Imports from aerosandbox.structures.beams import * import scipy.io as sio import copy ### Set up sweep variables masses = np.linspace(50, 800, 50) spans = np.linspace(30, 90, 50) Masses, Spans ...
import numpy as np import sympy as sp import pytest from devito import (Grid, Function, TimeFunction, Eq, Coefficient, Substitutions, Dimension, solve, Operator, NODE) from devito.finite_differences import Differentiable from devito.tools import as_tuple _PRECISION = 9 class TestSC(object): ...
###################################################################################################### ###################################################################################################### ###################################################################################################### # IMPORT L...
<filename>test/src/supervised/LinearRegressionV2/SimpleLinearRegression.py<gh_stars>0 import sys, os sys.path.append(os.path.abspath(__file__).split('test')[0]) import pandas as pd import scipy.io as io import matplotlib.pyplot as plt import numpy as np from pyml.supervised.linear_regression.LinearRegressionV2 import...
# coding=utf-8 import glob import inspect import os import dask.array as da import numpy as np import scipy.sparse as sp import scipy.stats as sst import xarray as xr import yaml from scipy.sparse import linalg as ln from dtscalibration.calibrate_utils import calibration_double_ended_ols from dtscalibration.calibrate...
import random import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import stats from one_time_scripts.visualisations.visualise_ea_runs import convert_file_into_dict month_shorts = ['jan', 'feb', 'mar', 'apr', 'may', 'june', 'july', 'aug', 'sep', 'oct', 'no...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 2値分類、他クラス分類に関する結果表示(csv出力もする) import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from math import sqrt from scipy import stats from .utils.utils import clopper_pearson from .utils.folder import folder_create from sklearn.metrics import roc_...
<reponame>daviddralle/daviddralle.github.io # -*- coding: utf-8 -*- ''' Functions for calculation of potential and actual evaporation from meteorological data. Potential and actual evaporation functions ========================================== - E0: Calculate Penman (1948, 1956) open water evaporation. ...
<filename>res/Tools/HistPlot.py #!/usr/bin/env python3 # # main.py # # Author: # <NAME> <<EMAIL>> # # Copyright (c) 2011 <NAME> # # 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 Foundation, eith...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy import linalg from sklearn import mixture cv_types = ['spherical', 'tied', 'diag', 'full'] def clustering(the_image_autoencoded, the_image_shape, number_of_clusters, extra_parameters='spherical'): cv_type = extra_parameters n_compon...
<filename>Scripts/simulation/clubs/club_service.py # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\clubs\club_service.py # Compiled at: 2020-07-17 2...
import pandas as pd import scanpy as sc import anndata as ad from scipy.stats import zscore import tensorflow.keras as keras from sklearn import preprocessing import pickle from collections import Counter #------------------------------------------------------ def prelabel(ada, df_meta, raw=True, z=1.2): #load to ...
#!/usr/bin/env python3 import sys import cv2 import numpy as np import math import rospy from std_msgs.msg import Header from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from sensor_msgs import point_cloud2 from sensor_msgs.msg import PointCloud2, PointField from visualization_msgs.msg import...
<gh_stars>1-10 __author__ = 'alex' import os import sys import numpy as np import config import log from astropy.io import fits as pyfits from astropy.stats import sigma_clipped_stats from scipy.ndimage import rotate import matplotlib.pyplot as plt # http://photutils.readthedocs.org/en/latest/photutils/...
<gh_stars>10-100 import cv2 import os import numpy as np from PIL import Image from skimage.color import rgb2hed from scipy import stats def nuclei_inpaint(img_path, lbl_path, out_path): try: os.stat(os.path.dirname(out_path + '/')) except: os.mkdir(os.path.dirname(out_path + '/')) im...
import FrEIA.framework as Ff import FrEIA.modules as Fm import FrEIA as Fr import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from typing import Callable from scipy.stats import special_ortho_group from attn_modules.attention_step import ISDP class Only_isdpAttnBlock(Fm.AllInOneBlock...
import sys import os import numpy as np from scipy import ndimage import pandas as pd import geopandas as gpd from shapely.geometry import Point, Polygon import shapefile from utility import * from visualize import * from process_risk_maps import * PARK = 'SWS_May2019' RESOLUTION = 1000 KERNEL_WIDTH = 5 PATROL_EFF...
import os import sys import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.utils.data from ASIS_Exps.network.pointnet2_utils import PointNetSetAbstractionMsg, PointNetSetAbstraction, PointNetFeaturePropagation from scipy.optimize import linear_sum_assignment from AS...
#!/usr/bin/env python # from __future__ import print_function import os, sys, re, json, time, astropy import numpy as np from astropy.table import Table, Column, hstack from copy import copy from numpy import log, log10, power, sum, sqrt, pi, exp pow = power lg = log10 ln = log from scipy.interpolate import Interpol...
<filename>util_bez2018.py import numpy as np import scipy.signal def ffGn(N, tdres, Hinput, noiseType, mu, sigma=1): """ Python ffGn implementation based on MATLAB code (ffGn.m); modified from https://github.com/mrkrd/cochlea/tree/master/cochlea/zilany2014/util.py """ # Check arguments are valid ...
<gh_stars>0 from functools import reduce import numpy as np import scipy.sparse as sparse from scipy.ndimage import zoom def deconvolute(matrix, bias, invert=False): """ Applies bias factors to a sparse matrix. Parameters ---------- matrix : scipy.sparse.spmatrix The matrix to bias. Will...
<reponame>jeyong/yakut # Copyright (c) 2021 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> # pylint: disable=too-many-locals from __future__ import annotations import sys import functools from typing import TYPE_CHECKING, Optional, Dict, Callable, List,...
import cv2 import os import numpy as np from reader import Reader from scipy import interpolate import logging logging.basicConfig(level=logging.INFO) def read_lidar(lidar_path, mat): lidar = np.fromfile(lidar_path, dtype=np.float32).reshape((-1, 4)) lidar[:, 3] = 1.0 camera = np.dot(mat, lidar.T) ret...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Author: <NAME> <sennrich [AT] cl.uzh.ch> # This program handles the combination of Moses phrase tables, either through # linear interpolation of the phrase translation probabilities/lexical weights, # or through a recomputation based on the (weighted) comb...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
<filename>videoanalyst/evaluation/davis_benchmark/davis2017/davis_evaluation.py import sys from tqdm import tqdm import warnings warnings.filterwarnings("ignore", category=RuntimeWarning) import numpy as np #from evaluation.tracking.davis_benchmark.davis2017.davis import DAVIS #from evaluation.tracking.davis_benchmark...
from typing import Callable, List, Optional import numpy as np from scipy.interpolate import interp1d from ..aliases import ParameterVector from .data_structures import Chain from .neb import run_NEB # Nudged-Elastic-Band def run_AutoNEB( init_chain: Chain, loss_function: Callable[[ParameterVector], float],...
<reponame>junlulocky/BGMM """ Gibbs sampler for Sub clustering by Chinese restaurant process mixture model (SubCRPMM) Date: 2017 """ from scipy.misc import logsumexp import numpy as np import time import math import logging from numpy import linalg as LA from scipy.special import gammaln from scipy.stats import berno...
""" This module contain utilities for the source finding routines """ import numpy import math import scipy.integrate from tkp.sourcefinder.gaussian import gaussian from tkp.utility import coordinates def generate_subthresholds(min_value, max_value, num_thresholds): """ Generate a series of ``num_thresholds``...