repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | demos/theme.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.895014 | from functools import partial
from pywebio import start_server, config
from pywebio.input import *
from pywebio.output import *
from pywebio.pin import *
from pywebio.session import *
def pin_widgets():
put_markdown("# Pin widget")
options = [
{
"label": "Option one",
"value":... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | demos/markdown_previewer.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.899282 | from pywebio import start_server
from pywebio.output import *
from pywebio.pin import *
from pywebio.session import set_env, download
def main():
"""Markdown Previewer"""
set_env(output_animation=False)
put_markdown("""# Markdown Live Preview
The online markdown editor with live preview. The source ... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | demos/output_usage.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.900492 | from pywebio import start_server
from pywebio.output import *
from pywebio.session import info as session_info
from functools import partial
def t(eng, chinese):
"""return English or Chinese text according to the user's browser language"""
return chinese if 'zh' in session_info.user_language else eng
def co... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | demos/wordle.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.903999 | import time
from pywebio import start_server, config
from pywebio.output import *
from pywebio.session import run_js, local as session_local
TODAY_WORD = 'PYWEBIO' # need to be uppercase
MAX_TRY = 6
WORD_LEN = len(TODAY_WORD)
CSS = """
.pywebio {padding-top: 0} .markdown-body table {display:table; width:250px; mar... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | demos/set_env_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.911231 | from pywebio import start_server
from pywebio.input import *
from pywebio.output import *
from pywebio.session import *
import datetime
import asyncio
def t(eng, chinese):
"""return English or Chinese text according to the user's browser language"""
return chinese if 'zh' in info.user_language else eng
asyn... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | docs/_ext/codeblock.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.915110 | import os
from docutils.parsers.rst import directives
from sphinx.directives.code import CodeBlock
import hashlib
class ExportableCodeBlock(CodeBlock):
option_spec = {
'summary': directives.unchanged,
'name': directives.unchanged,
}
names = set()
@staticmethod
def md5(str_data):... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.918291 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# Ensur... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/__version__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.924147 | __package__ = 'pywebio'
__description__ = 'Write interactive web app in script way.'
__url__ = 'https://pywebio.readthedocs.io'
__version__ = "1.8.4"
__version_info__ = (1, 8, 4, 0)
__author__ = 'WangWeimin'
__author_email__ = 'wang0.618@qq.com'
__license__ = 'MIT'
|
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:44.953995 | from . import input # enable `pywebio.input.xxx` expression without `import pywebio.input`
from . import output
from . import platform
from . import session
from . import pin
from .__version__ import __author__, __author_email__, __license__
from .__version__ import __description__, __url__, __version__
from .excepti... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.534834 | r"""
The ``platform`` module provides support for deploying PyWebIO applications in different ways.
.. contents::
:local:
.. seealso::
* :ref:`Use Guide: Server mode and Script mode <server_and_script_mode>`
* :ref:`Advanced Topic: Integration with Web Framework <integration_web_framework>`
.. _dir_deplo... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/input.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.536296 | """
This module provides functions to get all kinds of input of user from the browser
There are two ways to use the input functions, one is to call the input function alone to get a single input::
name = input("What's your name")
print("Your name is %s" % name)
The other is to use `input_group` to get multi... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/exceptions.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.553444 | """
pywebio.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of PyWebIO's exceptions.
"""
class SessionException(Exception):
"""Base class for PyWebIO session related exceptions"""
class SessionClosedException(SessionException):
"""The session has been closed abnormally"""
class SessionNotFoun... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/pin.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.555240 | """
``pywebio.pin`` --- Persistent input
===========================================================================
*pin == Persistent input == Pinning input widget to the page*
Overview
------------------
As you already know, the input function of PyWebIO is blocking
and the input form will be destroyed after succ... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/io_ctrl.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.569932 | """
输入输出的底层实现函数
"""
import inspect
import json
import logging
from collections import UserList
from functools import partial, wraps
from .session import chose_impl, next_client_event, get_current_task_id, get_current_session
from .utils import random_str
logger = logging.getLogger(__name__)
def scope2dom(name, no_c... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/aiohttp.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.579344 | import asyncio
import fnmatch
import json
import logging
import os
import typing
from functools import partial
from urllib.parse import urlparse
from aiohttp import web
from . import page
from .adaptor import ws as ws_adaptor
from .page import make_applications, render_page
from .remote_access import start_remote_acc... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/adaptor/http.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.587433 | """
本模块提供基于Http轮训的后端通用类和函数
.. attention::
PyWebIO 的会话状态保存在进程内,基于HTTP的会话不支持多进程部署的后端服务
比如使用 ``uWSGI`` 部署后端服务,并使用 ``--processes n`` 选项设置了多进程;
或者使用 ``nginx`` 等反向代理将流量负载到多个后端副本上。
"""
import asyncio
import fnmatch
import json
import logging
import threading
import time
from contextlib import contextmanager
from... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/output.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.588883 | r"""
This module provides functions to output all kinds of content to the user's browser, and supply flexible output control.
.. _output_func_list:
Functions list
---------------
..
Use https://www.tablesgenerator.com/text_tables to generate/update below table
| The following table shows the output-related funct... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/adaptor/ws.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:45.638003 | import abc
import asyncio
import json
import logging
import time
import typing
from typing import Dict, Optional
from ...session import CoroutineBasedSession, Session, ThreadBasedSession
from ...utils import LRUDict, iscoroutinefunction, isgeneratorfunction, random_str
from ..utils import deserialize_binary_event
log... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/bokeh.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.112997 | import asyncio
import re
from collections.abc import Sequence
from pywebio.output import *
from pywebio.session import get_info
requirejs_config_tpl = """
<script type="text/javascript">
require.config({
paths: {
"bokeh": "https://cdn.bokeh.org/bokeh/release/bokeh-__version__.min",
"bokeh-widgets"... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/django.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.130090 | import json
import logging
import os
import threading
from django.http import HttpResponse, HttpRequest
from . import page
from ..session import Session
from .adaptor.http import HttpContext, HttpHandler, run_event_loop
from .remote_access import start_remote_access_service
from .page import make_applications
from .u... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/fastapi.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.139611 | import asyncio
import logging
import os
import typing
from functools import partial
import uvicorn
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import HTMLResponse
from starlette.routing import Route, WebSocketRoute, Mount
from starlette.websockets import... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/flask.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.151880 | """
Flask backend
"""
import json
import logging
import os
import threading
import werkzeug
from flask import Flask, request, send_from_directory, Response
from . import page
from .adaptor.http import HttpContext, HttpHandler, run_event_loop
from .page import make_applications
from .remote_access import start_remote_... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/page.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.191651 | import json
import urllib.parse
from collections import namedtuple
from collections.abc import Mapping, Sequence
import functools
from os import path, environ
from tornado import template
from ..__version__ import __version__ as version
from ..utils import isgeneratorfunction, iscoroutinefunction, get_function_name, ... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/pyinstaller/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.193321 | import os
# Tell PyInstaller where to find hooks provided by this distribution;
# this is referenced by the :ref:`hook registration <hook_registration>`.
# This function returns a list containing only the path to this
# directory, which is the location of these hooks.
# # https://pyinstaller.readthedocs.io/en/stable/... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/remote_access.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.207616 | """
* Implementation of remote access
Use https://github.com/wang0618/localshare service by running a ssh subprocess in PyWebIO application.
The stdout of ssh process is the connection info.
"""
import json
import logging
import os
import threading
import time
import shlex
from subprocess import Popen, PIPE
import sh... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/tornado.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.212649 | import asyncio
import fnmatch
import json
import logging
import os
import threading
import typing
import webbrowser
from functools import partial
from typing import Callable, Dict, List, Optional, Union
from urllib.parse import urlparse
import tornado
import tornado.httpserver
import tornado.ioloop
import tornado.web
... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/pyinstaller/hook-pywebio.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:46.914449 | # This is a PyInstaller hook for pywebio.
# https://pyinstaller.readthedocs.io/en/stable/hooks.html
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('pywebio')
|
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/path_deploy.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:47.421366 | import ast
import os.path
from contextlib import contextmanager
from functools import partial
import tornado.template
import tornado.web
import tornado.ioloop
from . import page
from .adaptor.http import HttpHandler
from .page import make_applications
from .tornado import webio_handler, set_ioloop
from .tornado_http ... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | test/1.basic.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:47.629065 | import subprocess
import time
from selenium.webdriver import Chrome
import pywebio
import template
import util
from pywebio import start_server
from pywebio.input import *
from pywebio.session import set_env
from pywebio.utils import run_as_function
def target():
set_env(auto_scroll_bottom=True)
template.se... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | test/10.aiohttp_multiple_session_impliment.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:48.137751 | import subprocess
import time
from aiohttp import web
from selenium.webdriver import Chrome
import pywebio
import template
import util
from pywebio.input import *
from pywebio.platform.aiohttp import static_routes, webio_handler
from pywebio.utils import to_coroutine, run_as_function
def target():
template.basi... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/tornado_http.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.714266 | import os
import json
import logging
import tornado.ioloop
import tornado.web
from . import page
from ..session import Session
from .adaptor.http import HttpContext, HttpHandler
from .tornado import set_ioloop, _setup_server, open_webbrowser_on_server_started
from .utils import cdn_validation, print_listen_address
fr... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/platform/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.760286 | import fnmatch
import json
import os
import socket
import urllib.parse
from collections import defaultdict
from ..__version__ import __version__ as version
from ..exceptions import PyWebIOWarning
def cdn_validation(cdn, level='warn', stacklevel=3):
"""CDN availability check
:param bool/str cdn: cdn paramete... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/session/coroutinebased.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.766086 | import asyncio
import logging
import threading
from contextlib import contextmanager
from functools import partial
from .base import Session
from ..exceptions import SessionNotFoundException, SessionClosedException, SessionException
from ..utils import random_str, isgeneratorfunction, iscoroutinefunction
logger = log... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/session/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.774050 | import logging
import sys
import traceback
from collections import defaultdict
import user_agents
from ..exceptions import SessionException
logger = logging.getLogger(__name__)
class Session:
"""
会话对象,由Backend创建
属性:
info 表示会话信息的对象
save 会话的数据对象,提供用户在对象上保存一些会话相关数据
由Task在当前Session上下文中... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/session/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.782719 | r"""
.. autofunction:: download
.. autofunction:: run_js
.. autofunction:: eval_js
.. autofunction:: register_thread
.. autofunction:: defer_call
.. data:: local
The session-local object for current session.
``local`` is a dictionary object that can be accessed through attributes,
it aim to be used to s... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/session/threadbased.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.808829 | import logging
import queue
import threading
from functools import wraps
from .base import Session
from ..exceptions import SessionNotFoundException, SessionClosedException, SessionException
from ..utils import random_str, LimitedSizeQueue, isgeneratorfunction, iscoroutinefunction, \
get_function_name
logger = lo... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | pywebio/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.816287 | import asyncio
import functools
import inspect
import os
import queue
import random
import socket
import string
import time
from collections import OrderedDict
from contextlib import closing
from os.path import abspath, dirname, join, normpath
project_dir = dirname(abspath(__file__))
STATIC_PATH = join(project_dir, '... |
pywebio/PyWebIO | https://github.com/pywebio/PyWebIO | null | null | null | null | 4,822 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:51.823841 | import os
from functools import reduce
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(here, 'pywebio', '__version__.py'), encoding='utf8') as f:
exec(f.read(), about)
with open('README.md', encoding='utf8') as f:
readme = f.rea... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.956046 | from __future__ import division, print_function, absolute_import
from .pa100k import PA100K
__datasets = {'pa100k': PA100K}
def init_dataset(name, **kwargs):
avai_datasets = list(__datasets.keys())
if name not in avai_datasets:
raise ValueError(
'Invalid dataset name. Received "{}", '
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/DML/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.961406 | import sys
import copy
import time
import os.path as osp
import argparse
import torch
import torch.nn as nn
import torchreid
from torchreid.utils import (
Logger, check_isfile, set_random_seed, collect_env_info,
resume_from_checkpoint, load_pretrained_weights, compute_model_complexity
)
from dml import ImageD... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/DML/default_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.963089 | from yacs.config import CfgNode as CN
def get_default_config():
cfg = CN()
# model
cfg.model = CN()
cfg.model.name = 'resnet50'
cfg.model.pretrained = True # automatically load pretrained model weights if available
cfg.model.load_weights1 = '' # path to model-1 weights
cfg.model.load_weig... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/DML/dml.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.964073 | from __future__ import division, print_function, absolute_import
import torch
from torch.nn import functional as F
from torchreid.utils import open_all_layers, open_specified_layers
from torchreid.engine import Engine
from torchreid.losses import TripletLoss, CrossEntropyLoss
class ImageDMLEngine(Engine):
def _... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.983814 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/OSNet_AIN/softmax_nas.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.992711 | from __future__ import division, print_function, absolute_import
from torchreid import metrics
from torchreid.engine import Engine
from torchreid.losses import CrossEntropyLoss
class ImageSoftmaxNASEngine(Engine):
def __init__(
self,
datamanager,
model,
optimizer,
schedul... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/OSNet_AIN/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:53.993244 | import os
import sys
import time
import os.path as osp
import argparse
import torch
import torch.nn as nn
import torchreid
from torchreid.utils import (
Logger, check_isfile, set_random_seed, collect_env_info,
resume_from_checkpoint, compute_model_complexity
)
import osnet_search as osnet_models
from softmax_... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/OSNet_AIN/osnet_search.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.003961 | from __future__ import division, absolute_import
import torch
from torch import nn
from torch.nn import functional as F
EPS = 1e-12
NORM_AFFINE = False # enable affine transformations for normalization layer
##########
# Basic layers
##########
class IBN(nn.Module):
"""Instance + Batch Normalization."""
def... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/OSNet_AIN/default_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.025477 | from yacs.config import CfgNode as CN
def get_default_config():
cfg = CN()
# model
cfg.model = CN()
cfg.model.name = 'resnet50'
cfg.model.pretrained = True # automatically load pretrained model weights if available
cfg.model.load_weights = '' # path to model weights
cfg.model.resume = '' ... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/OSNet_AIN/osnet_child.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.055424 | from __future__ import division, absolute_import
from torch import nn
from torch.nn import functional as F
##########
# Basic layers
##########
class ConvLayer(nn.Module):
"""Convolution layer (conv + bn + relu)."""
def __init__(
self,
in_channels,
out_channels,
kernel_size,
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | scripts/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.826284 | import sys
import time
import os.path as osp
import argparse
import torch
import torch.nn as nn
import torchreid
from torchreid.utils import (
Logger, check_isfile, set_random_seed, collect_env_info,
resume_from_checkpoint, load_pretrained_weights, compute_model_complexity
)
from default_config import (
i... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.826937 | from __future__ import division, print_function
import sys
import copy
import time
import numpy as np
import os.path as osp
import datetime
import warnings
import torch
import torch.nn as nn
import torchreid
from torchreid.utils import (
Logger, AverageMeter, check_isfile, open_all_layers, save_checkpoint,
set... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/default_parser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.870861 | from __future__ import print_function, absolute_import
import argparse
def init_parser():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
# ************************************************************
# Datasets
# ********************************... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/models/osnet.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.872660 | from __future__ import division, absolute_import
import torch
from torch import nn
from torch.nn import functional as F
__all__ = ['osnet_avgpool', 'osnet_maxpool']
##########
# Basic layers
##########
class ConvLayer(nn.Module):
"""Convolution layer."""
def __init__(
self,
in_channels,
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/datasets/pa100k.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:54.896777 | from __future__ import division, print_function, absolute_import
import numpy as np
import os.path as osp
from scipy.io import loadmat
from .dataset import Dataset
class PA100K(Dataset):
"""Pedestrian attribute dataset.
80k training images + 20k test images.
The folder structure should be:
pa10... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/models/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.053309 | from __future__ import absolute_import
from .osnet import *
__model_factory = {
'osnet_avgpool': osnet_avgpool,
'osnet_maxpool': osnet_maxpool
}
def build_model(name, num_classes, pretrained=True, use_gpu=True):
avai_models = list(__model_factory.keys())
if name not in avai_models:
raise Key... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | scripts/default_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.072291 | from yacs.config import CfgNode as CN
def get_default_config():
cfg = CN()
# model
cfg.model = CN()
cfg.model.name = 'resnet50'
cfg.model.pretrained = True # automatically load pretrained model weights if available
cfg.model.load_weights = '' # path to model weights
cfg.model.resume = '' ... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.618591 | import numpy as np
import os.path as osp
from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Build import cythonize
def readme():
with open('README.rst') as f:
content = f.read()
return content
def find_version():
version_file = 'torchreid/__init__.p... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | tools/compute_mean_std.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.731707 | """
Compute channel-wise mean and standard deviation of a dataset.
Usage:
$ python compute_mean_std.py DATASET_ROOT DATASET_KEY
- The first argument points to the root path where you put the datasets.
- The second argument means the specific dataset key.
For instance, your datasets are put under $DATA and you wanna
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | tools/visualize_actmap.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.750411 | """Visualizes CNN activation maps to see where the CNN focuses on to extract features.
Reference:
- Zagoruyko and Komodakis. Paying more attention to attention: Improving the
performance of convolutional neural networks via attention transfer. ICLR, 2017
- Zhou et al. Omni-Scale Feature Learning for Pers... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.784538 | from __future__ import print_function, absolute_import
from .datasets import (
Dataset, ImageDataset, VideoDataset, register_image_dataset,
register_video_dataset
)
from .datamanager import ImageDataManager, VideoDataManager
|
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | tools/export.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:55.814490 | import argparse
import os
import sys
import numpy as np
from pathlib import Path
import torch
import pandas as pd
import subprocess
from torchreid.utils.feature_extractor import FeatureExtractor
from torchreid.models import build_model
__model_types = [
'resnet50', 'mlfn', 'hacnn', 'mobilenetv2_x1_0', 'mobilenetv... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.208547 | from __future__ import division, print_function, absolute_import
import copy
import numpy as np
import os.path as osp
import tarfile
import zipfile
import torch
from torchreid.utils import read_image, download_url, mkdir_if_missing
class Dataset(object):
"""An abstract class representing a Dataset.
This is ... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | tools/parse_test_res.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.210145 | """
This script aims to automate the process of calculating average results
stored in the test.log files over multiple splits.
How to use:
For example, you have done evaluation over 20 splits on VIPeR, leading to
the following file structure
log/
eval_viper/
split_0/
test.log-xxxx
spli... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.303336 | from __future__ import print_function, absolute_import
from .grid import GRID
from .prid import PRID
from .ilids import iLIDS
from .viper import VIPeR
from .cuhk01 import CUHK01
from .cuhk02 import CUHK02
from .cuhk03 import CUHK03
from .msmt17 import MSMT17
from .cuhksysu import CUHKSYSU
from .sensereid import SenseR... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | projects/attribute_recognition/datasets/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.361575 | from __future__ import division, print_function, absolute_import
import os.path as osp
from torchreid.utils import read_image
class Dataset(object):
def __init__(
self,
train,
val,
test,
attr_dict,
transform=None,
mode='train',
verbose=True,
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/cuhk01.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.362765 | from __future__ import division, print_function, absolute_import
import glob
import numpy as np
import os.path as osp
import zipfile
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class CUHK01(ImageDataset):
"""CUHK01.
Reference:
Li et al. Human Reidentificatio... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.412294 | from __future__ import print_function, absolute_import
from torchreid import data, optim, utils, engine, losses, models, metrics
__version__ = '1.4.0'
__author__ = 'Kaiyang Zhou'
__homepage__ = 'https://kaiyangzhou.github.io/'
__description__ = 'Deep learning person re-identification in PyTorch'
__url__ = 'https://gi... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/cuhk02.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.415758 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
from ..dataset import ImageDataset
class CUHK02(ImageDataset):
"""CUHK02.
Reference:
Li and Wang. Locally Aligned Feature Transforms across Views. CVPR 2013.
URL: `<http://www.ee.cuhk.edu.hk/~xgwa... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/cuhk03.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.433901 | from __future__ import division, print_function, absolute_import
import os.path as osp
from torchreid.utils import read_json, write_json, mkdir_if_missing
from ..dataset import ImageDataset
class CUHK03(ImageDataset):
"""CUHK03.
Reference:
Li et al. DeepReID: Deep Filter Pairing Neural Network for ... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/cuhksysu.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:56.747509 | from __future__ import division, print_function, absolute_import
import copy
import glob
import os.path as osp
from ..dataset import ImageDataset
class CUHKSYSU(ImageDataset):
"""CUHKSYSU.
This dataset can only be used for model training.
Reference:
Xiao et al. End-to-end deep learning for pers... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/ilids.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.114779 | from __future__ import division, print_function, absolute_import
import copy
import glob
import random
import os.path as osp
from collections import defaultdict
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class iLIDS(ImageDataset):
"""QMUL-iLIDS.
Reference:
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/sensereid.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.165304 | from __future__ import division, print_function, absolute_import
import copy
import glob
import os.path as osp
from ..dataset import ImageDataset
class SenseReID(ImageDataset):
"""SenseReID.
This dataset is used for test purpose only.
Reference:
Zhao et al. Spindle Net: Person Re-identification... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/prid.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.166600 | from __future__ import division, print_function, absolute_import
import random
import os.path as osp
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class PRID(ImageDataset):
"""PRID (single-shot version of prid-2011)
Reference:
Hirzer et al. Person Re-Identific... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/grid.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.277862 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
from scipy.io import loadmat
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class GRID(ImageDataset):
"""GRID.
Reference:
Loy et al. Multi-camera activity correla... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/market1501.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.312820 | from __future__ import division, print_function, absolute_import
import re
import glob
import os.path as osp
import warnings
from ..dataset import ImageDataset
class Market1501(ImageDataset):
"""Market1501.
Reference:
Zheng et al. Scalable Person Re-identification: A Benchmark. ICCV 2015.
URL: ... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/msmt17.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.424905 | from __future__ import division, print_function, absolute_import
import os.path as osp
from ..dataset import ImageDataset
# Log
# 22.01.2019
# - add v2
# - v1 and v2 differ in dir names
# - note that faces in v2 are blurred
TRAIN_DIR_KEY = 'train_dir'
TEST_DIR_KEY = 'test_dir'
VERSION_DICT = {
'MSMT17_V1': {
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/video/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.710833 | from __future__ import print_function, absolute_import
from .mars import Mars
from .ilidsvid import iLIDSVID
from .prid2011 import PRID2011
from .dukemtmcvidreid import DukeMTMCVidReID
|
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/video/ilidsvid.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.733857 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
from scipy.io import loadmat
from torchreid.utils import read_json, write_json
from ..dataset import VideoDataset
class iLIDSVID(VideoDataset):
"""iLIDS-VID.
Reference:
Wang et al. Person Re-Identific... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/video/dukemtmcvidreid.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.734398 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
import warnings
from torchreid.utils import read_json, write_json
from ..dataset import VideoDataset
class DukeMTMCVidReID(VideoDataset):
"""DukeMTMCVidReID.
Reference:
- Ristani et al. Performance Me... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/video/mars.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.863522 | from __future__ import division, print_function, absolute_import
import os.path as osp
import warnings
from scipy.io import loadmat
from ..dataset import VideoDataset
class Mars(VideoDataset):
"""MARS.
Reference:
Zheng et al. MARS: A Video Benchmark for Large-Scale Person Re-identification. ECCV 201... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/video/prid2011.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.917910 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
from torchreid.utils import read_json
from ..dataset import VideoDataset
class PRID2011(VideoDataset):
"""PRID2011.
Reference:
Hirzer et al. Person Re-Identification by Descriptive and
Discrim... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/sampler.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:57.977061 | from __future__ import division, absolute_import
import copy
import numpy as np
import random
from collections import defaultdict
from torch.utils.data.sampler import Sampler, RandomSampler, SequentialSampler
AVAI_SAMPLERS = [
'RandomIdentitySampler', 'SequentialSampler', 'RandomSampler',
'RandomDomainSampler'... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/engine/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:58.323698 | from __future__ import print_function, absolute_import
from .image import ImageSoftmaxEngine, ImageTripletEngine
from .video import VideoSoftmaxEngine, VideoTripletEngine
from .engine import Engine
|
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/transforms.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:58.353532 | from __future__ import division, print_function, absolute_import
import math
import random
from collections import deque
import torch
from PIL import Image
from torchvision.transforms import (
Resize, Compose, ToTensor, Normalize, ColorJitter, RandomHorizontalFlip
)
class Random2DTranslation(object):
"""Rando... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:00.835538 | from __future__ import print_function, absolute_import
from .image import (
GRID, PRID, CUHK01, CUHK02, CUHK03, MSMT17, CUHKSYSU, VIPeR, SenseReID,
Market1501, DukeMTMCreID, University1652, iLIDS
)
from .video import PRID2011, Mars, DukeMTMCVidReID, iLIDSVID
from .dataset import Dataset, ImageDataset, VideoDat... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datamanager.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:01.070939 | from __future__ import division, print_function, absolute_import
import torch
from torchreid.data.sampler import build_train_sampler
from torchreid.data.datasets import init_image_dataset, init_video_dataset
from torchreid.data.transforms import build_transforms
class DataManager(object):
r"""Base data manager.
... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/viper.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:02.590608 | from __future__ import division, print_function, absolute_import
import glob
import numpy as np
import os.path as osp
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class VIPeR(ImageDataset):
"""VIPeR.
Reference:
Gray et al. Evaluating appearance models for rec... |
KaiyangZhou/deep-person-reid | https://github.com/KaiyangZhou/deep-person-reid | null | null | null | null | 4,818 | null | null | mit | null | null | null | null | null | null | null | torchreid/data/datasets/image/university1652.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:02.755387 | from __future__ import division, print_function, absolute_import
import os
import glob
import os.path as osp
import gdown
from ..dataset import ImageDataset
class University1652(ImageDataset):
"""University-1652.
Reference:
- Zheng et al. University-1652: A Multi-view Multi-source Benchmark for Dron... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/format.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.134746 | from geopy import units
# Unicode characters for symbols that appear in coordinate strings.
DEGREE = chr(176)
PRIME = chr(8242)
DOUBLE_PRIME = chr(8243)
ASCII_DEGREE = ''
ASCII_PRIME = "'"
ASCII_DOUBLE_PRIME = '"'
LATIN1_DEGREE = chr(176)
HTML_DEGREE = '°'
HTML_PRIME = '′'
HTML_DOUBLE_PRIME = '″'
XML_D... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/geocoders/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.138299 | """
Each geolocation service you might use, such as Google Maps, Bing Maps, or
Nominatim, has its own class in ``geopy.geocoders`` abstracting the service's
API. Geocoders each define at least a ``geocode`` method, for resolving a
location from a string, and may define a ``reverse`` method, which resolves a
pair of coo... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/exc.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.139353 | """
Exceptions raised by geopy.
"""
class GeopyError(Exception):
"""
Geopy-specific exceptions are all inherited from GeopyError.
"""
class ConfigurationError(GeopyError, ValueError):
"""
When instantiating a geocoder, the arguments given were invalid. See
the documentation of each geocoder'... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/compat.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.140198 | try:
# >=3.7
from asyncio import current_task
except ImportError:
from asyncio import Task
current_task = Task.current_task
del Task
|
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/extra/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.142784 | # Extra modules are intentionally not exported here, to avoid
# them being always imported even when they are not needed.
|
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/adapters.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:05.143632 | """
Adapters are HTTP client implementations used by geocoders.
Some adapters might support keep-alives, request retries, http2,
persistence of Cookies, response compression and so on.
Adapters should be considered an implementation detail. Most of the time
you wouldn't need to know about their existence unless you w... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/extra/rate_limiter.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.418270 | """:class:`.RateLimiter` and :class:`.AsyncRateLimiter` allow to perform bulk
operations while gracefully handling error responses and adding delays
when needed.
In the example below a delay of 1 second (``min_delay_seconds=1``)
will be added between each pair of ``geolocator.geocode`` calls; all
:class:`geopy.exc.Geo... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.583024 | """
geopy is a Python client for several popular geocoding web services.
geopy makes it easy for Python developers to locate the coordinates of
addresses, cities, countries, and landmarks across the globe using third-party
geocoders and other data sources.
geopy is tested against CPython (versions 3.7, 3.8, 3.9, 3.10... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/distance.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.674139 | """
Geopy can calculate geodesic distance between two points using the
`geodesic distance
<https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid>`_ or the
`great-circle distance
<https://en.wikipedia.org/wiki/Great-circle_distance>`_,
with a default of the geodesic distance available as the function
``geopy.distance.... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/geocoders/arcgis.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.815572 | import json
from functools import partial
from time import time
from urllib.parse import urlencode
from geopy.exc import (
ConfigurationError,
GeocoderAuthenticationFailure,
GeocoderServiceError,
)
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder, _synchronized
from geopy.location import Locatio... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/geocoders/baidu.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.826289 | import hashlib
from functools import partial
from urllib.parse import quote_plus, urlencode
from geopy.exc import (
GeocoderAuthenticationFailure,
GeocoderQueryError,
GeocoderQuotaExceeded,
GeocoderServiceError,
)
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Lo... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/geocoders/databc.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.883446 | from functools import partial
from urllib.parse import urlencode
from geopy.exc import GeocoderQueryError
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("DataBC", )
class DataBC(Geocoder):
"""Geocoder using the Physical Ad... |
geopy/geopy | https://github.com/geopy/geopy | null | null | null | null | 4,809 | null | null | mit | null | null | null | null | null | null | null | geopy/geocoders/banfrance.py | null | null | null | null | null | null | Python | 2026-05-04T01:53:06.920271 | from functools import partial
from urllib.parse import urlencode
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("BANFrance", )
class BANFrance(Geocoder):
"""Geocoder using the Base Adresse Nationale France API.
Docume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.