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 |
|---|---|---|---|---|---|---|
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/replicate.py | # -*- coding: utf-8 -*-
# File : replicate.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 27/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
import functools
from torch.nn.parallel.da... | 3,226 | 32.968421 | 115 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/unittest.py | # -*- coding: utf-8 -*-
# File : unittest.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 27/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
import unittest
import torch
class TorchTes... | 768 | 24.633333 | 76 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/batchnorm.py | # -*- coding: utf-8 -*-
# File : batchnorm.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 27/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
import collections
import contextlib
import... | 16,465 | 38.869249 | 135 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/batchnorm_reimpl.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : batchnorm_reimpl.py
# Author : acgtyrant
# Date : 11/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
import torch
import torch.nn as nn
import torch... | 2,385 | 30.813333 | 95 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/comm.py | # -*- coding: utf-8 -*-
# File : comm.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 27/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
import queue
import collections
import threading... | 4,449 | 31.246377 | 117 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/sync_batchnorm/__init__.py | # -*- coding: utf-8 -*-
# File : __init__.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 27/01/2018
#
# This file is part of Synchronized-BatchNorm-PyTorch.
# https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
# Distributed under MIT License.
from .batchnorm import set_sbn_eps_mode
from ... | 547 | 35.533333 | 96 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/transformers.py | import torch
from torch.nn import Module, ModuleList, Linear, Dropout, LayerNorm, Identity, Parameter, init
import torch.nn.functional as F
from .stochastic_depth import DropPath
class Attention(Module):
"""
Obtained from timm: github.com:rwightman/pytorch-image-models
"""
def __init__(self, dim, num... | 13,211 | 38.088757 | 112 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/embedder.py | import torch.nn as nn
class Embedder(nn.Module):
def __init__(self,
word_embedding_dim=300,
vocab_size=100000,
padding_idx=1,
pretrained_weight=None,
embed_freeze=False,
*args, **kwargs):
super(Embedder, ... | 1,332 | 34.078947 | 96 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/stochastic_depth.py | # Thanks to rwightman's timm package
# github.com:rwightman/pytorch-image-models
import torch
import torch.nn as nn
def drop_path(x, drop_prob: float = 0., training: bool = False):
"""
Obtained from: github.com:rwightman/pytorch-image-models
Drop paths (Stochastic Depth) per sample (when applied in main ... | 1,586 | 38.675 | 108 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/cct.py | from torch.hub import load_state_dict_from_url
import torch.nn as nn
import torch
import torch.nn.functional as F
from .transformers import TransformerClassifier
from .tokenizer import Tokenizer
from .helpers import pe_check
from timm.models.registry import register_model
model_urls = {
'cct_7_3x1_32':
'... | 15,794 | 42.753463 | 114 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/tokenizer.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class Tokenizer(nn.Module):
def __init__(self,
kernel_size, stride, padding,
pooling_kernel_size=3, pooling_stride=2, pooling_padding=1,
n_conv_layers=1,
n_input_channels=3,
... | 4,035 | 35.690909 | 95 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/__init__.py | from .cct import cct_14_7x2_384, cct_14_7x2_224 | 47 | 47 | 47 | py |
deep-visual-geo-localization-benchmark | deep-visual-geo-localization-benchmark-main/model/cct/helpers.py | import math
import torch
import torch.nn.functional as F
def resize_pos_embed(posemb, posemb_new, num_tokens=1):
# Copied from `timm` by Ross Wightman:
# github.com/rwightman/pytorch-image-models
# Rescale the grid of position embeddings when loading from state_dict. Adapted from
# https://github.com/... | 1,573 | 46.69697 | 132 | py |
anomaly-seg | anomaly-seg-master/anom_utils.py | import numpy as np
import sklearn.metrics as sk
recall_level_default = 0.95
def stable_cumsum(arr, rtol=1e-05, atol=1e-08):
"""Use high precision for cumsum and check that final value matches sum
Parameters
----------
arr : array-like
To be cumulatively summed as flat
rtol : float
... | 4,508 | 37.538462 | 118 | py |
anomaly-seg | anomaly-seg-master/create_bdd_dataset.py | import numpy as np
import scipy
import scipy.io as sio
import scipy.misc
from scipy.misc import imread, imsave
import matplotlib
import matplotlib.pyplot as plt
import json
import os
import os.path
from tqdm import tqdm
# replace the colors with our colors
#a = sio.loadmat("data_ADE/color150.mat")
# print(a)
colors =... | 4,282 | 25.115854 | 90 | py |
anomaly-seg | anomaly-seg-master/dataset.py | import os
import json
import torch
from torchvision import transforms
import numpy as np
from PIL import Image
def imresize(im, size, interp='bilinear'):
if interp == 'nearest':
resample = Image.NEAREST
elif interp == 'bilinear':
resample = Image.BILINEAR
elif interp == 'bicubic':
... | 11,901 | 39.074074 | 108 | py |
anomaly-seg | anomaly-seg-master/defaults.py | from yacs.config import CfgNode as CN
# -----------------------------------------------------------------------------
# Config definition
# -----------------------------------------------------------------------------
_C = CN()
_C.DIR = "ckpt/ade20k-resnet50dilated-ppm_deepsup"
# ------------------------------------... | 3,625 | 32.266055 | 79 | py |
anomaly-seg | anomaly-seg-master/create_dataset.py | import numpy as np
import scipy
import scipy.io as sio
import scipy.misc
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import json
import os
import os.path
from tqdm import tqdm
# Replace the colors with our colors
# This is only used for visualization purposes
#color_mat = sio.loadmat("data... | 4,611 | 27.645963 | 97 | py |
anomaly-seg | anomaly-seg-master/eval_ood.py | # System libs
import os
import time
import argparse
from distutils.version import LooseVersion
# Numerical libs
import numpy as np
import torch
import torch.nn as nn
from scipy.io import loadmat
# Our libs
from config import cfg
from dataset import ValDataset
from models import ModelBuilder, SegmentationModule
from uti... | 10,392 | 34.35034 | 116 | py |
fmriprep | fmriprep-master/wrapper/src/fmriprep_docker/__main__.py | #!/usr/bin/env python
"""
The *fMRIPrep* on Docker wrapper
This is a lightweight Python wrapper to run *fMRIPrep*.
Docker must be installed and running. This can be checked
running ::
docker info
Please acknowledge this work using the citation boilerplate that *fMRIPrep* includes
in the visual report generated for... | 18,982 | 30.170772 | 99 | py |
fmriprep | fmriprep-master/wrapper/src/fmriprep_docker/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/scripts/fetch_templates.py | #!/usr/bin/env python
"""
Standalone script to facilitate caching of required TemplateFlow templates.
To download and view how to use this script, run the following commands inside a terminal:
1. wget https://raw.githubusercontent.com/nipreps/fmriprep/master/scripts/fetch_templates.py
2. python fetch_templates.py -h
"... | 4,945 | 35.910448 | 92 | py |
fmriprep | fmriprep-master/scripts/generate_reference_mask.py | #!/usr/bin/env python
import sys
from nipype.pipeline import engine as pe
from nipype.interfaces import utility as niu
from niworkflows.func.util import init_bold_reference_wf
def sink_mask_file(in_file, orig_file, out_dir):
import os
from nipype.utils.filemanip import fname_presuffix, copyfile
os.makedir... | 1,153 | 27.85 | 74 | py |
fmriprep | fmriprep-master/docs/conf.py | # fmriprep documentation build configuration file, created by
# sphinx-quickstart on Mon May 9 09:04:25 2016.
#
# 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.
#
# All configuration values h... | 11,942 | 32.642254 | 89 | py |
fmriprep | fmriprep-master/docs/sphinxext/github_link.py | """
This script comes from scikit-learn:
https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/github_link.py
"""
from operator import attrgetter
import inspect
import subprocess
import os
import sys
from functools import partial
REVISION_CMD = 'git rev-parse --short HEAD'
def _get_git_revision():
... | 2,803 | 30.505618 | 85 | py |
fmriprep | fmriprep-master/.maint/update_authors.py | #!/usr/bin/env python3
"""Update and sort the creators list of the zenodo record."""
import sys
from pathlib import Path
import json
import click
from fuzzywuzzy import fuzz, process
def read_md_table(md_text):
"""
Extract the first table found in a markdown document as a Python dict.
Examples
------... | 9,037 | 28.061093 | 99 | py |
fmriprep | fmriprep-master/.maint/update_zenodo.py | #!/usr/bin/env python3
"""Update and sort the creators list of the zenodo record."""
import sys
from pathlib import Path
import json
from fuzzywuzzy import fuzz, process
# These ORCIDs should go last
CREATORS_LAST = ['Poldrack, Russell A.', 'Gorgolewski, Krzysztof J.']
CONTRIBUTORS_LAST = ['Ghosh, Satrajit S.']
def ... | 5,620 | 35.5 | 87 | py |
fmriprep | fmriprep-master/.maint/paper_author_list.py | #!/usr/bin/env python3
"""Generate an author list for a new paper or abstract."""
import sys
from pathlib import Path
import json
from update_zenodo import get_git_lines, sort_contributors
# These authors should go last
AUTHORS_LAST = ['Gorgolewski, Krzysztof J.', 'Poldrack, Russell A.', 'Esteban, Oscar']
def _asli... | 1,711 | 33.24 | 91 | py |
fmriprep | fmriprep-master/fmriprep/__main__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,162 | 33.205882 | 74 | py |
fmriprep | fmriprep-master/fmriprep/conftest.py | import json
import os
from pathlib import Path
from shutil import copytree
import nibabel as nb
import numpy as np
import pytest
try:
from importlib.resources import files as ir_files
except ImportError: # PY<3.9
from importlib_resources import files as ir_files
os.environ['NO_ET'] = '1'
def copytree_or_s... | 1,273 | 26.695652 | 98 | py |
fmriprep | fmriprep-master/fmriprep/_warnings.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,520 | 32.065217 | 83 | py |
fmriprep | fmriprep-master/fmriprep/config.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 27,180 | 34.072258 | 99 | py |
fmriprep | fmriprep-master/fmriprep/__init__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Top-module metadata."""
from .__about__ import __copyright__, __credits__, __packagename__, __version__
__all__ = [
'__copyright__',
'__credits__',
'__packagename__',
'__version__',
]
... | 682 | 25.269231 | 79 | py |
fmriprep | fmriprep-master/fmriprep/__about__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,387 | 32.853659 | 82 | py |
fmriprep | fmriprep-master/fmriprep/cli/parser.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 30,254 | 35.190191 | 99 | py |
fmriprep | fmriprep-master/fmriprep/cli/run.py | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 10,249 | 35.870504 | 95 | py |
fmriprep | fmriprep-master/fmriprep/cli/version.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 3,268 | 29.551402 | 94 | py |
fmriprep | fmriprep-master/fmriprep/cli/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/cli/workflow.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 8,484 | 36.214912 | 99 | py |
fmriprep | fmriprep-master/fmriprep/cli/tests/test_parser.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 6,755 | 28.373913 | 97 | py |
fmriprep | fmriprep-master/fmriprep/cli/tests/test_version.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 6,603 | 29.293578 | 90 | py |
fmriprep | fmriprep-master/fmriprep/cli/tests/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/workflows/base.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 23,060 | 37.435 | 100 | py |
fmriprep | fmriprep-master/fmriprep/workflows/tests.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 2,182 | 32.075758 | 89 | py |
fmriprep | fmriprep-master/fmriprep/workflows/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/workflows/bold/base.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 51,518 | 36.660088 | 99 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/registration.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 37,874 | 36.462908 | 125 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/resampling.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 48,435 | 33.230389 | 99 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/t2s.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 7,684 | 33.308036 | 152 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/confounds.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 29,485 | 36.371356 | 99 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/hmc.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 4,442 | 32.156716 | 98 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/__init__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Pre-processing fMRI - BOLD signal workflows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: fmriprep.workflows.bold.base
.. automodule:: fmriprep.workflows.bold.hmc
.. automodule:: fmripre... | 1,189 | 26.674419 | 73 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/outputs.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 34,824 | 36.977099 | 98 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/stc.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 4,722 | 33.474453 | 99 | py |
fmriprep | fmriprep-master/fmriprep/workflows/bold/tests/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/workflows/bold/tests/test_base.py | from copy import deepcopy
import bids
from niworkflows.utils.testing import generate_bids_skeleton
from sdcflows.fieldmaps import clear_registry
from sdcflows.utils.wrangler import find_estimators
from ..base import get_estimator
BASE_LAYOUT = {
"01": {
"anat": [{"suffix": "T1w"}],
"func": [
... | 4,446 | 34.576 | 96 | py |
fmriprep | fmriprep-master/fmriprep/tests/test_fsl6.py | import shutil
from pathlib import Path
import pytest
import templateflow.api as tf
from looseversion import LooseVersion
from nipype.interfaces import fsl
fslversion = fsl.Info.version()
TEMPLATE = tf.get("MNI152NLin2009cAsym", resolution=2, desc=None, suffix="T1w")
@pytest.mark.skipif(fslversion is None, reason="f... | 1,312 | 31.02439 | 90 | py |
fmriprep | fmriprep-master/fmriprep/tests/test_config.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 4,033 | 31.532258 | 95 | py |
fmriprep | fmriprep-master/fmriprep/tests/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/reports/core.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 3,608 | 28.581967 | 90 | py |
fmriprep | fmriprep-master/fmriprep/reports/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/utils/meepi.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,552 | 32.76087 | 81 | py |
fmriprep | fmriprep-master/fmriprep/utils/bids.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 7,052 | 36.515957 | 97 | py |
fmriprep | fmriprep-master/fmriprep/utils/telemetry.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 6,916 | 32.095694 | 95 | py |
fmriprep | fmriprep-master/fmriprep/utils/misc.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,600 | 32.354167 | 94 | py |
fmriprep | fmriprep-master/fmriprep/utils/testing.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 5,440 | 41.84252 | 98 | py |
fmriprep | fmriprep-master/fmriprep/utils/confounds.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 6,256 | 38.10625 | 91 | py |
fmriprep | fmriprep-master/fmriprep/utils/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/utils/debug.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.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... | 2,784 | 33.8125 | 105 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/patches.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 2,239 | 27 | 74 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/multiecho.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 3,635 | 30.894737 | 93 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/conftest.py | from pathlib import Path
from shutil import copytree
import pytest
try:
from contextlib import chdir as _chdir
except ImportError: # PY310
import os
from contextlib import contextmanager
@contextmanager # type: ignore
def _chdir(path):
cwd = os.getcwd()
os.chdir(path)
tr... | 1,011 | 23.682927 | 88 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/gifti.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Interfaces for manipulating GIFTI files."""
import os
import nibabel as nb
import numpy as np
from nipype.interfaces.base import File, SimpleInterface, TraitedSpec, isdefined, traits
class CreateROIIn... | 2,100 | 31.828125 | 94 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/workbench.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""This module provides interfaces for workbench surface commands."""
import os
from nipype import logging
from nipype.interfaces.base import (
CommandLine,
CommandLineInputSpec,
File,
Trai... | 27,812 | 33.379481 | 98 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/maths.py | import os
import numpy as np
from nipype.interfaces.base import File, SimpleInterface, TraitedSpec, traits
from nipype.utils.filemanip import fname_presuffix
class ClipInputSpec(TraitedSpec):
in_file = File(exists=True, mandatory=True, desc="Input imaging file")
out_file = File(desc="Output file name")
m... | 2,680 | 30.541176 | 98 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/reports.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 13,763 | 35.031414 | 99 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/confounds.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 15,506 | 33.769058 | 99 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/__init__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from niworkflows.interfaces.bids import DerivativesDataSink as _DDSink
class DerivativesDataSink(_DDSink):
out_path_base = ""
__all__ = ("DerivativesDataSink",)
| 283 | 24.818182 | 73 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/tests/test_confounds.py | from pathlib import Path
from nipype.pipeline import engine as pe
from fmriprep.interfaces import confounds
def test_RenameACompCor(tmp_path, data_dir):
renamer = pe.Node(confounds.RenameACompCor(), name="renamer", base_dir=str(tmp_path))
renamer.inputs.components_file = data_dir / "acompcor_truncated.tsv"
... | 1,205 | 36.6875 | 89 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/tests/test_reports.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.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... | 1,883 | 34.54717 | 74 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/tests/__init__.py | 0 | 0 | 0 | py | |
fmriprep | fmriprep-master/fmriprep/interfaces/tests/test_maths.py | import nibabel as nb
import numpy as np
from nipype.pipeline import engine as pe
from fmriprep.interfaces.maths import Clip
def test_Clip(tmp_path):
in_file = str(tmp_path / "input.nii")
data = np.array([[[-1.0, 1.0], [-2.0, 2.0]]])
nb.Nifti1Image(data, np.eye(4)).to_filename(in_file)
threshold = pe... | 1,557 | 34.409091 | 98 | py |
fmriprep | fmriprep-master/fmriprep/interfaces/tests/data/__init__.py | 0 | 0 | 0 | py | |
vldbsubmission | vldbsubmission-master/python_src/SirApplication3data.py | from hgDecompose.utils import get_hg, writeHypergraphHg, writeHypergraph, get_random_hg,save_dictascsv
from hgDecompose.Hypergraph import Hypergraph
import random,os
import time
import argparse,pickle,copy
from hgDecompose.optimizedhgDecompose import HGDecompose
from matplotlib import pyplot as plt
import networkx as ... | 5,173 | 36.492754 | 111 | py |
vldbsubmission | vldbsubmission-master/python_src/run.py | # import sys
# sys.path.append("HyperNetX")
# import matplotlib.pyplot as plt
import networkx as nx
# import hypernetx as hnx
# from hgDecompose.hgDecompose import HGDecompose
# from hgDecompose.utils import get_hg_hnx
# from hgDecompose.newhgDecompose import HGDecompose
from hgDecompose.optimizedhgDecompose import HGD... | 8,416 | 45.761111 | 224 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/BasicHypergraph.py | import math
import itertools
import random
class Hypergraph:
"""
Our own hypergraph representation class.
We store hyperedge list in compressed format using two things- 1) e_indices (a dict) 2) e_nodes (a list)
Although edge-centric queries (e.g. edge enumeration) are facilitated in this way, node-c... | 15,113 | 35.773723 | 127 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/Hypergraph.py | import math
import itertools
import random
# from typing import final
class Hypergraph:
"""
Our own hypergraph representation class.
We store hyperedge list in compressed format using two things- 1) e_indices (a dict) 2) e_nodes (a list)
Although edge-centric queries (e.g. edge enumeration) are faci... | 29,577 | 39.078591 | 136 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/utils.py | # from hgDecompose.optimizedhgDecompose import HGDecompose
from numpy.core.fromnumeric import mean
import pandas as pd
from hgDecompose.Hypergraph import Hypergraph
import random
import heapq
from hgDecompose.heapdict import heapdict
from disjoint_set import DisjointSet
import pickle
import math
def strong_subgraph(H... | 19,330 | 29.394654 | 207 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/optimizedhgDecompose.py | from json.encoder import INFINITY
from time import time
import math
from hgDecompose.Hypergraph import Hypergraph
from copy import deepcopy
from multiprocessing import Pool
from hgDecompose.utils import operator_H, par_operator_H
from hgDecompose.heapdict import heapdict
import pandas as pd
# from tests.verify_kcore im... | 8,466 | 35.65368 | 140 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/heapdict.py | try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
def doc(s):
if hasattr(s, '__call__'):
s = s.__doc__
def f(g):
g.__doc__ = s
return g
return f
class heapdict(MutableMapping):
__marker = object()
def __in... | 2,947 | 24.413793 | 130 | py |
vldbsubmission | vldbsubmission-master/python_src/hgDecompose/influence_propagation.py | import random
import numpy as np
from copy import deepcopy
from multiprocessing import Pool
import os
import pickle
from hgDecompose.utils import check_connectivity, component_sz, save_dict, avg_shortest_pathlen
pkl_path = 'sirdata/'
def propagate_for_all_vertices(H, core, num_vertex_per_core=100, top_k=100, p=0.5, ... | 16,654 | 36.093541 | 157 | py |
PIBConv | PIBConv-main/cnn/extract_cifar10.py | # Python 3 program to visualize 4th image
import matplotlib.pyplot as plt
import numpy as np
import cv2
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='latin1')
return dict
def upSampleCIFAR10():
file = r'/fs2/comm/kpgrp/mhosseini/github/ConvS... | 1,090 | 24.97619 | 104 | py |
PIBConv | PIBConv-main/cnn/complexity.py | import torch
from model import *
from genotypes import *
from ptflops import get_model_complexity_info
def print_complexity(network):
macs, params = get_model_complexity_info(network, (3, 32, 32), as_strings=True,
print_per_layer_stat=True, verbose=True)
print('{:<30}... | 788 | 31.875 | 127 | py |
PIBConv | PIBConv-main/cnn/train_cpath.py | import os
import sys
import time
import glob
import numpy as np
import torch
import utils
import logging
import argparse
import genotypes
import torch.nn as nn
import torch.utils
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from model import NetworkADP as... | 13,664 | 43.366883 | 118 | py |
PIBConv | PIBConv-main/cnn/apply_gradcam.py | import argparse
import cv2
import numpy as np
import torch
from torchvision import models
from pytorch_grad_cam import GradCAM, \
HiResCAM, \
ScoreCAM, \
GradCAMPlusPlus, \
AblationCAM, \
XGradCAM, \
EigenCAM, \
EigenGradCAM, \
LayerCAM, \
FullGrad, \
GradCAMElementWise
from mode... | 5,853 | 34.26506 | 100 | py |
PIBConv | PIBConv-main/cnn/test_cpath.py | import os
import sys
import glob
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import torch.utils
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from model import NetworkADP as Network
# for ADP dataset
fr... | 7,551 | 42.154286 | 141 | py |
PIBConv | PIBConv-main/cnn/train_search_rmsgd.py | from operator import index
import os
#os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
#os.environ["CUDA_VISIBLE_DEVICES"] = "1,2,3"
print("bruv")
import sys
import time
import glob
import utils
import logging
import argparse
import numpy as np
import pandas as pd
import pickle
import torch
import torch.nn as nn
import t... | 24,566 | 42.713523 | 153 | py |
PIBConv | PIBConv-main/cnn/architect.py | import torch
import numpy as np
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from collections import OrderedDict
def _concat(xs):
return torch.cat([x.view(-1) for x in xs])
class Architect(object):
def __init__(self, model, criterion, args):
gpus = [... | 11,819 | 48.456067 | 133 | py |
PIBConv | PIBConv-main/cnn/train_imagenet.py | import os
import sys
import numpy as np
import time
import torch
import utils
import glob
import random
import logging
import argparse
import torch.nn as nn
import genotypes
import torch.utils
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torch.backends.cudnn as cudnn
from torc... | 8,636 | 34.9875 | 106 | py |
PIBConv | PIBConv-main/cnn/train_search_adas.py | import os
import sys
import time
import glob
import utils
import logging
import argparse
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
import pickle
import gc
from cop... | 22,044 | 43.445565 | 153 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.