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 |
|---|---|---|---|---|---|---|
gevent | gevent-master/src/gevent/tests/test__core_callback.py | import gevent
from gevent.hub import get_hub
from gevent import testing as greentest
class Test(greentest.TestCase):
def test(self):
loop = get_hub().loop
called = []
def f():
called.append(1)
x = loop.run_callback(f)
assert x, x
gevent.sleep(0)
... | 618 | 17.757576 | 39 | py |
gevent | gevent-master/src/gevent/tests/_import_wait.py | # test__import_wait.py calls this via an import statement,
# so all of this is happening with import locks held (especially on py2)
import gevent
def fn2():
return 2
# A blocking function doesn't raise LoopExit
def fn():
return gevent.wait([gevent.spawn(fn2), gevent.spawn(fn2)])
gevent.spawn(fn).get()
# ... | 570 | 20.148148 | 72 | py |
gevent | gevent-master/src/gevent/tests/test__socket.py | from __future__ import print_function
from __future__ import absolute_import
from gevent import monkey
# This line can be commented out so that most tests run with the
# system socket for comparison.
monkey.patch_all()
import sys
import array
import socket
import time
import unittest
from functools import wraps
impo... | 23,489 | 34.483384 | 102 | py |
gevent | gevent-master/src/gevent/tests/test__local.py | import gevent.testing as greentest
from copy import copy
# Comment the line below to see that the standard thread.local is working correct
from gevent import monkey; monkey.patch_all()
from threading import local
from threading import Thread
from zope import interface
try:
from collections.abc import Mapping
ex... | 11,741 | 26.56338 | 99 | py |
gevent | gevent-master/src/gevent/tests/test___ident.py | # -*- coding: utf-8 -*-
# copyright 2018 gevent contributors. See LICENSE for details.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gc
import gevent.testing as greentest
from gevent._ident import IdentRegistry
from gevent._compat import PYPY
cl... | 2,109 | 25.049383 | 72 | py |
gevent | gevent-master/src/gevent/tests/test__issue1864.py | import sys
import unittest
from gevent import testing as greentest
class TestSubnormalFloatsAreNotDisabled(unittest.TestCase):
@greentest.skipOnCI('Some of our tests we compile with -Ofast, which breaks this.')
def test_subnormal_is_not_zero(self):
# Enabling the -Ofast compiler flag resulted in subn... | 1,291 | 43.551724 | 98 | py |
gevent | gevent-master/src/gevent/tests/test__issue607.py | # A greenlet that's killed with an exception should fail.
import gevent.testing as greentest
import gevent
class ExpectedError(greentest.ExpectedException):
pass
def f():
gevent.sleep(999)
class TestKillWithException(greentest.TestCase):
def test_kill_without_exception(self):
g = gevent.spawn... | 1,354 | 27.229167 | 61 | py |
gevent | gevent-master/src/gevent/tests/test__loop_callback.py | from gevent import get_hub
from gevent import testing as greentest
class Test(greentest.TestCase):
def test(self):
count = [0]
def incr():
count[0] += 1
loop = get_hub().loop
loop.run_callback(incr)
loop.run()
self.assertEqual(count, [1])
if __name__ ... | 356 | 17.789474 | 39 | py |
gevent | gevent-master/src/gevent/tests/test__ares_host_result.py | from __future__ import print_function
import pickle
import gevent.testing as greentest
try:
from gevent.resolver.cares import ares_host_result
except ImportError: # pragma: no cover
ares_host_result = None
@greentest.skipIf(ares_host_result is None,
"Must be able to import ares")
class Test... | 908 | 26.545455 | 58 | py |
gevent | gevent-master/src/gevent/tests/test__issue6.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
if not sys.argv[1:]:
from subprocess import Popen, PIPE
# not on Py2 pylint:disable=consider-using-with
p = Popen([sys.executable, __file__, 'subprocess'], stdin=PIPE, stdout=PIPE, stder... | 1,530 | 37.275 | 100 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/__main__.py | from __future__ import print_function
# This file makes this directory into a runnable package.
# it exists to test 'python -m gevent.monkey monkey_package'
# Note that the __file__ may differ slightly; starting with
# Python 3.9, directly running it gets an abspath, but
# using ``runpy`` doesn't.
import os.path
print(... | 363 | 35.4 | 60 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/script.py | # -*- coding: utf-8 -*-
"""
Test script file, to be used directly as a file.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# We need some global imports
from textwrap import dedent
def use_import():
return dedent(" text")
if __name__ == '__ma... | 427 | 19.380952 | 48 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/threadpool_monkey_patches.py | # -*- coding: utf-8 -*-
"""
This file runs ``gevent.monkey.patch_all()``.
It is intended to be used by ``python -m gevent.monkey <this file>``
to prove that monkey-patching twice doesn't have unfortunate sife effects (such as
breaking the threadpool).
"""
from __future__ import absolute_import
from __future__ import d... | 869 | 27.064516 | 82 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/threadpool_no_monkey.py | # -*- coding: utf-8 -*-
"""
This file *does not* run ``gevent.monkey.patch_all()``.
It is intended to be used by ``python -m gevent.monkey <this file>``
to prove that the threadpool and getting the original value of things
works.
"""
from __future__ import absolute_import
from __future__ import division
from __future_... | 787 | 24.419355 | 69 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/issue302monkey.py | from __future__ import print_function
import socket
import sys
import os.path
if sys.argv[1] == 'patched':
print('gevent' in repr(socket.socket))
else:
assert sys.argv[1] == 'stdlib'
print('gevent' not in repr(socket.socket))
print(os.path.abspath(__file__))
if sys.argv[1] == 'patched':
# __package__... | 935 | 33.666667 | 69 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/issue1526_with_monkey.py | # -*- coding: utf-8 -*-
"""
Test for issue #1526:
- dnspython is imported first;
- monkey-patching happens early
"""
from __future__ import print_function, absolute_import
from gevent import monkey
monkey.patch_all()
# pylint:disable=import-error
import dns
assert dns
import socket
import sys
socket.getfqdn()
impor... | 666 | 22 | 59 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/__init__.py | # -*- coding: utf-8 -*-
"""
Make a package.
This file has no other functionality. Individual modules in this package
are used for testing, often being run with 'python -m ...' in individual
test cases (functions).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_... | 329 | 24.384615 | 72 | py |
gevent | gevent-master/src/gevent/tests/monkey_package/issue1526_no_monkey.py | # -*- coding: utf-8 -*-
"""
Test for issue #1526:
- dnspython is imported first;
- no monkey-patching is done.
"""
from __future__ import print_function
from __future__ import absolute_import
import dns # pylint:disable=import-error
assert dns
import gevent.socket as socket # pylint:disable=consider-using-from-import
... | 573 | 25.090909 | 74 | py |
gevent | gevent-master/src/gevent/libev/watcher.py | # pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable
# pylint: disable=no-member
from __future__ import absolute_import, print_function
import sys
from gevent.libev import _corecffi # pylint:disable=no-name-in-module,import-error
# Nothing public here
__all__ = []
ffi = _corecffi.f... | 7,999 | 26.777778 | 92 | py |
gevent | gevent-master/src/gevent/libev/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Nothing public here
__all__ = []
| 169 | 20.25 | 38 | py |
gevent | gevent-master/src/gevent/libev/_corecffi_build.py | # pylint: disable=no-member
# This module is only used to create and compile the gevent._corecffi module;
# nothing should be directly imported from it except `ffi`, which should only be
# used for `ffi.compile()`; programs should import gevent._corecfffi.
# However, because we are using "out-of-line" mode, it is nece... | 4,059 | 30.968504 | 86 | py |
gevent | gevent-master/src/gevent/libev/corecffi.py | # pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable
# pylint: disable=no-member
from __future__ import absolute_import, print_function
import sys
# pylint: disable=undefined-all-variable
__all__ = [
'get_version',
'get_header_version',
'supported_backends',
'recommend... | 13,720 | 28.131635 | 125 | py |
gevent | gevent-master/src/gevent/resolver/_hostsfile.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 gevent contributors. See LICENSE for details.
#
# Portions of this code taken from dnspython
# https://github.com/rthalley/dnspython
#
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to us... | 4,629 | 30.712329 | 88 | py |
gevent | gevent-master/src/gevent/resolver/_addresses.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 gevent contributors. See LICENSE for details.
#
# Portions of this code taken from dnspython
# https://github.com/rthalley/dnspython
#
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to us... | 4,795 | 28.243902 | 76 | py |
gevent | gevent-master/src/gevent/resolver/thread.py | # Copyright (c) 2012-2015 Denis Bilenko. See LICENSE for details.
"""
Native thread-based hostname resolver.
"""
import _socket
from gevent.hub import get_hub
__all__ = ['Resolver']
class Resolver(object):
"""
Implementation of the resolver API using native threads and native resolution
functions.
... | 2,487 | 34.542857 | 82 | py |
gevent | gevent-master/src/gevent/resolver/ares.py | # Copyright (c) 2011-2015 Denis Bilenko. See LICENSE for details.
"""
c-ares based hostname resolver.
"""
from __future__ import absolute_import, print_function, division
import os
import warnings
from _socket import gaierror
from _socket import herror
from _socket import error
from _socket import EAI_NONAME
from gev... | 12,890 | 35.415254 | 97 | py |
gevent | gevent-master/src/gevent/resolver/__init__.py | # Copyright (c) 2018 gevent contributors. See LICENSE for details.
import _socket
from _socket import AF_INET
from _socket import AF_UNSPEC
from _socket import AI_CANONNAME
from _socket import AI_PASSIVE
from _socket import AI_NUMERICHOST
from _socket import EAI_NONAME
from _socket import EAI_SERVICE
from _socket imp... | 10,760 | 36.625874 | 97 | py |
gevent | gevent-master/src/gevent/resolver/dnspython.py | # Copyright (c) 2018 gevent contributors. See LICENSE for details.
# Portions of this code taken from the gogreen project:
# http://github.com/slideinc/gogreen
#
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are pe... | 20,663 | 39.517647 | 97 | py |
gevent | gevent-master/src/gevent/resolver/blocking.py | # Copyright (c) 2018 gevent contributors. See LICENSE for details.
import _socket
__all__ = [
'Resolver',
]
class Resolver(object):
"""
A resolver that directly uses the system's resolver functions.
.. caution::
This resolver is *not* cooperative.
This resolver has the lowest overhead... | 1,216 | 25.456522 | 76 | py |
gevent | gevent-master/src/gevent/_ffi/watcher.py | """
Useful base classes for watchers. The available
watchers will depend on the specific event loop.
"""
# pylint:disable=not-callable
from __future__ import absolute_import, print_function
import signal as signalmodule
import functools
import warnings
from gevent._config import config
from gevent._util import LazyOn... | 20,954 | 31.488372 | 116 | py |
gevent | gevent-master/src/gevent/_ffi/loop.py | """
Basic loop implementation for ffi-based cores.
"""
# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable
from __future__ import absolute_import, print_function
from collections import deque
import sys
import os
import traceback
from gevent._ffi import _dbg
from gevent._ffi import ... | 31,948 | 39.187421 | 108 | py |
gevent | gevent-master/src/gevent/_ffi/__init__.py | """
Internal helpers for FFI implementations.
"""
from __future__ import print_function, absolute_import
import os
import sys
def _dbg(*args, **kwargs):
# pylint:disable=unused-argument
pass
#_dbg = print
def _pid_dbg(*args, **kwargs):
kwargs['file'] = sys.stderr
print(os.getpid(), *args, **kwargs)
... | 493 | 16.642857 | 74 | py |
gevent | gevent-master/src/gevent/_ffi/callback.py | from __future__ import absolute_import
from __future__ import print_function
from zope.interface import implementer
from gevent._interfaces import ICallback
__all__ = [
'callback',
]
@implementer(ICallback)
class callback(object):
__slots__ = ('callback', 'args')
def __init__(self, cb, args):
... | 1,564 | 25.982759 | 92 | py |
gevent | gevent-master/src/gevent/libuv/watcher.py | # pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable
# pylint: disable=no-member
from __future__ import absolute_import, print_function
import functools
import sys
from gevent.libuv import _corecffi # pylint:disable=no-name-in-module,import-error
# Nothing public here
__all__ = []
... | 27,699 | 35.256545 | 100 | py |
gevent | gevent-master/src/gevent/libuv/loop.py | """
libuv loop implementation
"""
# pylint: disable=no-member
from __future__ import absolute_import, print_function
import os
from collections import defaultdict
from collections import namedtuple
from operator import delitem
import signal
from zope.interface import implementer
from gevent import getcurrent
from ge... | 27,626 | 38.981187 | 109 | py |
gevent | gevent-master/src/gevent/libuv/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Nothing public here
__all__ = []
| 169 | 20.25 | 38 | py |
gevent | gevent-master/src/gevent/libuv/_corecffi_build.py | # pylint: disable=no-member
# This module is only used to create and compile the gevent.libuv._corecffi module;
# nothing should be directly imported from it except `ffi`, which should only be
# used for `ffi.compile()`; programs should import gevent._corecfffi.
# However, because we are using "out-of-line" mode, it i... | 12,349 | 34.693642 | 110 | py |
gevent | gevent-master/scripts/gprospector.py | from __future__ import print_function
import re
import sys
from prospector.run import main
def _excepthook(e, t, tb):
while tb is not None:
frame = tb.tb_frame
print(frame.f_code, frame.f_code.co_name)
for n in ('self', 'node', 'elt'):
if n in frame.f_locals:
pr... | 540 | 22.521739 | 68 | py |
gevent | gevent-master/scripts/releases/appveyor-download.py | #!/usr/bin/env python
"""
Use the AppVeyor API to download Windows artifacts.
Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
i... | 4,494 | 31.810219 | 94 | py |
gevent | gevent-master/docs/conf.py | # -*- coding: utf-8 -*-
#
# gevent documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 1 09:30:02 2009.
#
# 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 ... | 8,686 | 31.535581 | 154 | py |
Voxurf | Voxurf-main/run.py | import os, sys, copy, glob, json, time, random, argparse, cv2
from shutil import copyfile
from tqdm import tqdm, trange
import math
import mmcv
import imageio
import numpy as np
import trimesh
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from datetime import datetime
from lib impor... | 56,095 | 49.130474 | 210 | py |
Voxurf | Voxurf-main/tools/vis_train.py | import argparse
import numpy as np
import open3d as o3d
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('path')
args = parser.parse_args()
data = np.load(args.path)
xyz_min = data['xyz_min']
xyz_max = data['xyz_max']
cam_lst = data['cam_lst']
# Outer aabb
... | 1,778 | 33.211538 | 118 | py |
Voxurf | Voxurf-main/tools/tools.py | import os
from shutil import copyfile
def find_and_rename(root):
dirs = os.listdir(root)
if not os.path.exists(os.path.join(root, 'explore')):
os.mkdir(os.path.join(root, 'explore'))
for dir in dirs:
if not os.path.isdir(os.path.join(root, dir)):
continue
name = os.path.... | 542 | 30.941176 | 76 | py |
Voxurf | Voxurf-main/tools/vis_volume.py | import argparse
import numpy as np
import mcubes
import open3d as o3d
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('path')
parser.add_argument('thres', type=float)
parser.add_argument('--cam')
args = parser.parse_args()
data = np.load(args.path)
alpha = ... | 3,444 | 35.648936 | 118 | py |
Voxurf | Voxurf-main/tools/preprocess/process_video.py | from rembg.bg import remove
import numpy as np
import io
from PIL import Image
import configargparse
import os
import cv2
import mmcv
from PIL import ImageFile
import argparse
ImageFile.LOAD_TRUNCATED_IMAGES = True
def add_white_bg(input_path, masks_out_path, white_bg=False):
if not os.path.exists(masks_out_path... | 2,455 | 34.085714 | 91 | py |
Voxurf | Voxurf-main/tools/preprocess/convert_cameras.py | import numpy as np
# import matplotlib.image as mpimg
# import matplotlib.pyplot as plt
# import cv2
# import argparse
# from glob import glob
import torch
import os
import argparse
import glob
import imageio
def _load_colmap(basedir, convert=True, suffix=''):
poses_arr = np.load(os.path.join(basedir, 'poses_bou... | 9,091 | 38.021459 | 116 | py |
Voxurf | Voxurf-main/tools/preprocess/preprocess_cameras.py | import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import cv2
import argparse
from glob import glob
import os
def get_Ps(cameras,number_of_cameras):
Ps = []
for i in range(0, number_of_cameras):
P = cameras['world_mat_%d' % i][:3, :].astype(np.float64)
Ps.appen... | 10,497 | 37.738007 | 158 | py |
Voxurf | Voxurf-main/tools/preprocess/colmap_poses/pose_utils.py | import numpy as np
import os
import sys
import imageio
import skimage.transform
from colmap_wrapper import run_colmap
import colmap_read_model as read_model
import argparse
def save_poses(basedir, poses, pts3d, perm):
pts_arr = []
vis_arr = []
for k in pts3d:
pts_arr.append(pts3d[k].xyz)
c... | 10,078 | 33.875433 | 139 | py |
Voxurf | Voxurf-main/tools/preprocess/colmap_poses/colmap_read_model.py | # Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | 14,086 | 41.558912 | 97 | py |
Voxurf | Voxurf-main/tools/preprocess/colmap_poses/colmap_wrapper.py | import os
import subprocess
# $ DATASET_PATH=/path/to/dataset
# $ colmap feature_extractor \
# --database_path $DATASET_PATH/database.db \
# --image_path $DATASET_PATH/images
# $ colmap exhaustive_matcher \
# --database_path $DATASET_PATH/database.db
# $ mkdir $DATASET_PATH/sparse
# $ colmap mapper \
# ... | 2,569 | 31.531646 | 116 | py |
Voxurf | Voxurf-main/tools/preprocess/colmap_poses/__init__.py | 0 | 0 | 0 | py | |
Voxurf | Voxurf-main/configs/default_fine_s.py | import os
from copy import deepcopy
expname = None # experiment name
basedir = os.path.join('.', 'logs') # where to store ckpts and logs
''' Template of data options
'''
data = dict(
datadir=None, # path to dataset root folder
dataset_type=None, # blender | ns... | 5,897 | 40.829787 | 127 | py |
Voxurf | Voxurf-main/configs/default.py | import os
from copy import deepcopy
expname = None # experiment name
basedir = os.path.join('.', 'logs') # where to store ckpts and logs
''' Template of data options
'''
data = dict(
datadir=None, # path to dataset root folder
dataset_type=None, # blender | ns... | 4,745 | 46.939394 | 127 | py |
Voxurf | Voxurf-main/configs/dtu_e2e_womask/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'dtu')
train_all = True
reso_level = 2
exp_stage = 'coarse'
use_sp_color = False
white_list = [24, 40, 110]
black_list = [37, 55, 63, 65, 69, 83, 97, 105, 106, 114, 118, 122]
data = dict(
datadir=os.p... | 1,955 | 20.977528 | 126 | py |
Voxurf | Voxurf-main/configs/dtu_e2e_womask/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'dtu')
train_all = False
reso_level = 1
exp_stage = 'fine'
use_sp_color = False
white_list = [24, 40, 110]
black_list = [37, 55, 63, 65, 69, 83, 97, 105, 106, 114, 118, 122]
data = dict(
datadir=os.pa... | 2,892 | 26.292453 | 140 | py |
Voxurf | Voxurf-main/configs/dtu_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'dtu')
train_all = True
reso_level = 2
exp_stage = 'coarse'
use_sp_color = True
white_list = [24, 40, 110]
black_list = [37, 55, 63, 65, 69, 83, 97, 105, 106, 114, 118, 122]
data = dict(
datadir=os.p... | 1,671 | 20.714286 | 126 | py |
Voxurf | Voxurf-main/configs/dtu_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'dtu')
train_all = False
reso_level = 1
exp_stage = 'fine'
use_sp_color = True
white_list = [24, 40, 110]
black_list = [37, 55, 63, 65, 69, 83, 97, 105, 106, 114, 118, 122]
data = dict(
datadir=os.pat... | 2,507 | 26.866667 | 140 | py |
Voxurf | Voxurf-main/configs/deepvoxels_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'deepvoxels')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data', 'deepvoxels'),
dataset_type='deepvoxels',
# inverse_y=True,
white_bkgd=Tru... | 1,566 | 20.465753 | 126 | py |
Voxurf | Voxurf-main/configs/deepvoxels_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'deepvoxels')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data', 'deepvoxels'),
dataset_type='deepvoxels',
# inverse_y=True,
white_bkgd=True... | 2,473 | 27.436782 | 140 | py |
Voxurf | Voxurf-main/configs/blendedmvs_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'blended_mvs')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data', 'BlendedMVS'),
dataset_type='blendedmvs',
inverse_y=True,
white_bkgd=True... | 1,627 | 21.30137 | 126 | py |
Voxurf | Voxurf-main/configs/blendedmvs_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'blended_mvs')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data', 'BlendedMVS'),
dataset_type='blendedmvs',
inverse_y=True,
white_bkgd=True,... | 2,697 | 29.659091 | 162 | py |
Voxurf | Voxurf-main/configs/tanks_and_temple_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'tanks_and_temple')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data', 'TanksAndTemple'),
dataset_type='tankstemple',
inverse_y=True,
load2... | 1,605 | 20.702703 | 126 | py |
Voxurf | Voxurf-main/configs/tanks_and_temple_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'tanks_and_temple')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data', 'TanksAndTemple'),
dataset_type='tankstemple',
inverse_y=True,
load2g... | 2,442 | 26.761364 | 140 | py |
Voxurf | Voxurf-main/configs/mobilebrick_e2e_womask/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = ''
basedir = os.path.join('.', 'logs', 'mobile_brick')
train_all = True
reso_level = 2
exp_stage = 'coarse'
use_sp_color = False
data = dict(
datadir=os.path.join('.', 'data', 'mobile_brick', 'test'),
dataset_type='mobile_brick',
inver... | 1,880 | 20.62069 | 126 | py |
Voxurf | Voxurf-main/configs/mobilebrick_e2e_womask/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = ''
basedir = os.path.join('.', 'logs', 'mobile_brick')
train_all = False
reso_level = 1
exp_stage = 'fine'
use_sp_color = False
data = dict(
datadir=os.path.join('.', 'data', 'mobile_brick', 'test'),
dataset_type='mobile_brick',
invers... | 2,818 | 26.105769 | 140 | py |
Voxurf | Voxurf-main/configs/custom_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'custom')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data'),
dataset_type='dtu',
inverse_y=True,
white_bkgd= False
)
surf_train=dict(
... | 1,540 | 20.109589 | 126 | py |
Voxurf | Voxurf-main/configs/custom_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'custom')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data'),
dataset_type='dtu',
inverse_y=True,
white_bkgd=False,
)
surf_train=dict(
... | 2,377 | 26.333333 | 140 | py |
Voxurf | Voxurf-main/configs/nvsf_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'nsvf')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data', 'Synthetic_NSVF'),
dataset_type='nsvf',
inverse_y=True,
white_bkgd=True,
)
sur... | 1,557 | 20.054054 | 126 | py |
Voxurf | Voxurf-main/configs/nvsf_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'nsvf')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data', 'Synthetic_NSVF'),
dataset_type='nsvf',
inverse_y=True,
white_bkgd=True,
)
surf... | 2,394 | 26.215909 | 140 | py |
Voxurf | Voxurf-main/configs/nerf_synthetic_e2e/coarse.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'nerf_synthetic')
train_all = True
reso_level = 2
exp_stage = 'coarse'
data = dict(
datadir=os.path.join('.', 'data', 'nerf_synthetic'),
dataset_type='blender',
# inverse_y=True,
white_bkg... | 1,571 | 20.534247 | 126 | py |
Voxurf | Voxurf-main/configs/nerf_synthetic_e2e/fine.py | import os
_base_ = os.path.join('..', 'default_fine_s.py')
expname = 'scan'
basedir = os.path.join('.', 'logs', 'nerf_synthetic')
train_all = False
reso_level = 1
exp_stage = 'fine'
data = dict(
datadir=os.path.join('.', 'data', 'nerf_synthetic'),
dataset_type='blender',
# inverse_y=True,
white_bkgd... | 2,641 | 29.022727 | 162 | py |
Voxurf | Voxurf-main/lib/load_dtu.py | import torch
import torch.nn.functional as F
import cv2 as cv
import numpy as np
import os
from glob import glob
from icecream import ic
from scipy.spatial.transform import Rotation as Rot
from scipy.spatial.transform import Slerp
import imageio
# This function is borrowed from IDR: https://github.com/lioryariv/idr
de... | 7,606 | 41.497207 | 120 | py |
Voxurf | Voxurf-main/lib/dvgo_ori.py | import os
import time
import functools
import numpy as np
import cv2
import mcubes
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
'''Model'''
class DirectVoxGO(torch.nn.Module):
def __init__(self, xyz_min, xyz_max,
num_voxels=0, num_voxels_base=... | 32,546 | 45.231534 | 149 | py |
Voxurf | Voxurf-main/lib/load_nsvf.py | import os
import glob
import torch
import numpy as np
import imageio
import json
import torch.nn.functional as F
import cv2
trans_t = lambda t : torch.Tensor([
[1,0,0,0],
[0,1,0,0],
[0,0,1,t],
[0,0,0,1]]).float()
rot_phi = lambda phi : torch.Tensor([
[1,0,0,0],
[0,np.cos(phi),-np.sin(phi),0],... | 1,712 | 26.629032 | 115 | py |
Voxurf | Voxurf-main/lib/voxurf_womask_coarse.py | import os
import time
import functools
import numpy as np
import cv2
import math
import random
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.dvgo_ori import extract_geometry
import copy
# import MinkowskiEngine as Me
from . import grid
from torch_scatter im... | 44,856 | 42.720273 | 162 | py |
Voxurf | Voxurf-main/lib/load_blendedmvs.py | import os
import glob
import torch
import numpy as np
import imageio
import json
import torch.nn.functional as F
import cv2
def load_blendedmvs_data(basedir):
pose_paths = sorted(glob.glob(os.path.join(basedir, 'pose', '*txt')))
rgb_paths = sorted(glob.glob(os.path.join(basedir, 'rgb', '*png')))
all_pose... | 1,312 | 30.261905 | 118 | py |
Voxurf | Voxurf-main/lib/voxurf_womask_fine.py | import os
import time
import functools
import numpy as np
from copy import deepcopy
import cv2
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.dvgo_ori import extract_geometry
import math
import random
import copy
from . import grid
from torch_scatter import s... | 65,267 | 43.61244 | 162 | py |
Voxurf | Voxurf-main/lib/voxurf_coarse.py | import os
import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import segment_coo
from torch.utils.cpp_extension import load
from . import grid
from lib.dvgo_ori import extract_geometry
parent_dir = os.path.dirna... | 40,171 | 42.760349 | 153 | py |
Voxurf | Voxurf-main/lib/load_mobilebrick.py | import torch
import torch.nn.functional as F
import cv2 as cv
import numpy as np
import os
from glob import glob
from icecream import ic
from scipy.spatial.transform import Rotation as Rot
from scipy.spatial.transform import Slerp
import imageio
# This function is borrowed from IDR: https://github.com/lioryariv/idr
de... | 3,429 | 34.360825 | 114 | py |
Voxurf | Voxurf-main/lib/utils.py | import os, math
import numpy as np
import scipy.signal
from typing import List, Optional
from torch import Tensor
import torch
import torch.nn as nn
import torch.nn.functional as F
import cv2
import matplotlib.pyplot as plt
from plyfile import PlyData, PlyElement
import matplotlib.cm as cm
import matplotlib as matplot... | 45,758 | 36.848635 | 132 | py |
Voxurf | Voxurf-main/lib/ref_utils.py | # Copyright 2022 Google 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 agreed to in writing, ... | 6,003 | 35.609756 | 84 | py |
Voxurf | Voxurf-main/lib/dtu_eval.py | # NeuralWarp All rights reseved to Thales LAS and ENPC.
#
# This code is freely available for academic use only and Provided “as is” without any warranty.
#
# Modification are allowed for academic research provided that the following conditions are met :
# * Redistributions of source code or any format must reta... | 7,399 | 38.361702 | 193 | py |
Voxurf | Voxurf-main/lib/load_co3d.py | import os
import json
import gzip
import glob
import torch
import numpy as np
import imageio
import torch.nn.functional as F
import cv2
def load_co3d_data(cfg):
# load meta
with gzip.open(cfg.annot_path, 'rt', encoding='utf8') as zipfile:
annot = [v for v in json.load(zipfile) if v['sequence_name'] =... | 3,135 | 35.465116 | 109 | py |
Voxurf | Voxurf-main/lib/load_tankstemple.py | import os
import glob
import torch
import numpy as np
import imageio
import json
import torch.nn.functional as F
import cv2
def load_tankstemple_data(basedir):
pose_paths = sorted(glob.glob(os.path.join(basedir, 'pose', '*txt')))
rgb_paths = sorted(glob.glob(os.path.join(basedir, 'rgb', '*png')))
all_pos... | 3,813 | 32.752212 | 117 | py |
Voxurf | Voxurf-main/lib/load_scannet.py | import os
import torch
import torch.nn.functional as F
import numpy as np
from glob import glob
import cv2
import random
import imageio
import skimage
def load_rgb(path, normalize_rgb = False):
img = imageio.imread(path)
img = skimage.img_as_float32(img)
# if normalize_rgb: # [-1,1] --> [0,1]
# ... | 6,003 | 31.106952 | 153 | py |
Voxurf | Voxurf-main/lib/voxurf_fine.py | import os
import time
import numpy as np
from copy import deepcopy
import cv2
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.dvgo_ori import extract_geometry
from torch_scatter import segment_coo
from . import grid
from torch.utils.cpp_extension ... | 51,680 | 42.871817 | 153 | py |
Voxurf | Voxurf-main/lib/load_nerfpp.py | '''
Modify from
https://github.com/Kai-46/nerfplusplus/blob/master/data_loader_split.py
'''
import os
import glob
import scipy
import imageio
import numpy as np
import torch
########################################################################################################################
# camera coordinate syst... | 5,638 | 33.175758 | 120 | py |
Voxurf | Voxurf-main/lib/grid.py | import os
import time
import functools
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.cpp_extension import load
parent_dir = os.path.dirname(os.path.abspath(__file__))
render_utils_cuda = load(
name='render_utils_cuda',
sources=[
os.p... | 11,636 | 46.11336 | 134 | py |
Voxurf | Voxurf-main/lib/load_data.py | import numpy as np
import os
from .load_blender import load_blender_data
from .load_nsvf import load_nsvf_data
from .load_blendedmvs import load_blendedmvs_data
from .load_tankstemple import load_tankstemple_data, load_tankstemple_data_bound
from .load_nerfpp import load_nerfpp_data
from .load_deepvoxels import load_d... | 8,870 | 37.737991 | 166 | py |
Voxurf | Voxurf-main/lib/load_blender.py | import os
import torch
import numpy as np
import imageio
import json
import torch.nn.functional as F
import cv2
trans_t = lambda t : torch.Tensor([
[1,0,0,0],
[0,1,0,0],
[0,0,1,t],
[0,0,0,1]]).float()
rot_phi = lambda phi : torch.Tensor([
[1,0,0,0],
[0,np.cos(phi),-np.sin(phi),0],
[0,np.s... | 2,553 | 27.065934 | 115 | py |
Voxurf | Voxurf-main/lib/load_llff.py | import numpy as np
import os, imageio
import glob
import shutil
########## Slightly modified version of LLFF data loading code
########## see https://github.com/Fyusion/LLFF for original
def imread(f):
if f.endswith('png'):
return imageio.imread(f, ignoregamma=True)
else:
return imageio.imrea... | 11,205 | 31.108883 | 139 | py |
Voxurf | Voxurf-main/lib/load_deepvoxels.py | import os
import numpy as np
import imageio
def load_dv_data(scene='cube', basedir='/data/deepvoxels', testskip=1):
def parse_intrinsics(filepath, trgt_sidelength, invert_y=False):
# Get camera intrinsics
with open(filepath, 'r') as file:
f, cx, cy = list(map(float, file.readline().sp... | 3,844 | 34.601852 | 142 | py |
Voxurf | Voxurf-main/lib/load_volsdf_bmvs.py | import torch
import torch.nn.functional as F
import cv2 as cv
import numpy as np
import os
from glob import glob
from icecream import ic
from scipy.spatial.transform import Rotation as Rot
from scipy.spatial.transform import Slerp
import imageio
# This function is borrowed from IDR: https://github.com/lioryariv/idr
de... | 2,879 | 34.121951 | 111 | py |
tesserocr | tesserocr-master/setup.py | import codecs
import errno
import glob
import itertools
import logging
import os
import re
import subprocess
import sys
from os.path import abspath, dirname
from os.path import join as pjoin
from os.path import split as psplit
from setuptools import setup
from setuptools.command.build_ext import build_ext
from setupto... | 11,241 | 32.75976 | 87 | py |
tesserocr | tesserocr-master/tests/test_api.py | import unittest
import re
import os.path
import tesserocr
try:
from PIL import Image
pil_installed = True
except ImportError:
pil_installed = False
def version_to_int(version):
subversion = None
subtrahend = 0
# Subtracts a certain amount from the version number to differentiate
# betwee... | 13,971 | 38.357746 | 88 | py |
tesserocr | tesserocr-master/tests/__init__.py | 0 | 0 | 0 | py | |
Dialogue-to-Video-Retrieval | Dialogue-to-Video-Retrieval-main/modeling.py | from collections import OrderedDict
from typing import Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn import CrossEntropyLoss
from transformers import CLIPProcessor, CLIPModel
from torch import Tensor
from dataclasses import dataclass
from typing import... | 29,954 | 40.146978 | 122 | py |
Dialogue-to-Video-Retrieval | Dialogue-to-Video-Retrieval-main/data_preprocess.py | from tqdm import tqdm
import json
import codecs
import requests
import pandas as pd
from transformers import BertTokenizer, AutoTokenizer
from os import listdir
from os.path import isfile, join
import torch
import numpy as np
import random
json_load = lambda x: json.load(codecs.open(x, 'r', encoding='utf-8'))
json_dum... | 13,897 | 32.570048 | 115 | py |
Dialogue-to-Video-Retrieval | Dialogue-to-Video-Retrieval-main/run_dialogue_to_video_retrieval.py | """ running training and evaluation code for dialogue-to-video retrieval
Created by Chenyang Lyu
"""
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from torch.utils.data.distributed import DistributedSampler
from torch.utils.data import TensorDataset
from tra... | 25,440 | 46.025878 | 180 | py |
PLRDiff | PLRDiff-main/test_single.py | import argparse
import os
import numpy as np
import torch as th
import torch.nn.functional as nF
from pathlib import Path
from guided_diffusion import utils
from guided_diffusion.create import create_model_and_diffusion_RS
import scipy.io as sio
from collections import OrderedDict
from os.path import join
from skimag... | 5,697 | 35.292994 | 146 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.