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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/imagenet.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.716470 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import datasets
import datasets.imagenet
import os, sys
from datasets.i... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/factory.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.725900 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Factory method for easily getting imdbs by name."""
from __future__ ... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/ds_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.730243 | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/coco.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.733368 | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/imdb.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.734990 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.754397 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.759779 | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/pascal_voc_rbg.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:12.766283 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/tools/mcg_munge.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.254525 | import os
import sys
"""Hacky tool to convert file system layout of MCG boxes downloaded from
http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/mcg/
so that it's consistent with those computed by Jan Hosang (see:
http://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal-
computing/research... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/vg.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.263605 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/vg_eval.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.311115 | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
import xml.etree.ElementTree as ET
import os
import cPickle
import numpy as np
from voc_eval im... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/datasets/voc_eval.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.327804 | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import pr... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/fpn/fpn.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.349123 | import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable, gradcheck
from torch.autograd.gradcheck import gradgradcheck
import torchvision.models as models
from torch.autograd import Variable
import numpy as np
import torchvision.utils as vutils
from model.util... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/fpn/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.370192 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from model.utils.config import cfg
from model.fpn.fpn import _FPN
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
import torch.utils.model_zoo... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/nms/_ext/nms/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.853868 |
from torch.utils.ffi import _wrap_function
from ._nms import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
locals[symbol] = _wrap_function(fn, _ffi)
__all__.append(symbol)
_import_symbols(locals())
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/nms/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.900221 | import os
import torch
from torch.utils.ffi import create_extension
#this_file = os.path.dirname(__file__)
sources = []
headers = []
defines = []
with_cuda = False
if torch.cuda.is_available():
print('Including CUDA code.')
sources += ['src/nms_cuda.c']
headers += ['src/nms_cuda.h']
defines += [('WIT... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/nms/nms_gpu.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.956673 | import torch
import numpy as np
from _ext import nms
import pdb
def nms_gpu(dets, thresh):
keep = dets.new(dets.size(0), 1).zero_().int()
num_out = dets.new(1).zero_().int()
nms.nms_cuda(keep, dets, num_out, thresh)
keep = keep[:num_out[0]]
return keep
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/nms/nms_wrapper.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.957790 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import torch
from model.utils.config import cfg
from model.nms.nms_gpu i... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_align/_ext/roi_align/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.968991 |
from torch.utils.ffi import _wrap_function
from ._roi_align import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
locals[symbol] = _wrap_function(fn, _ffi)
__all__.append(symbol)
_import_symbols(locals())
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_align/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:13.985411 | import os
import torch
from torch.utils.ffi import create_extension
# sources = ['src/roi_align.c']
# headers = ['src/roi_align.h']
sources = []
headers = []
defines = []
with_cuda = False
if torch.cuda.is_available():
print('Including CUDA code.')
sources += ['src/roi_align_cuda.c']
headers += ['src/roi_... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_align/functions/roi_align.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:14.032244 | import torch
from torch.autograd import Function
from .._ext import roi_align
# TODO use save_for_backward instead
class RoIAlignFunction(Function):
def __init__(self, aligned_height, aligned_width, spatial_scale):
self.aligned_width = int(aligned_width)
self.aligned_height = int(aligned_height)
... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/functions/crop_resize.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:14.871454 | # functions/add.py
import torch
from torch.autograd import Function
from .._ext import roi_crop
from cffi import FFI
ffi = FFI()
class RoICropFunction(Function):
def forward(self, input1, input2):
self.input1 = input1
self.input2 = input2
self.device_c = ffi.new("int *")
output = to... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/_ext/roi_crop/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:14.873148 |
from torch.utils.ffi import _wrap_function
from ._roi_crop import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
locals[symbol] = _wrap_function(fn, _ffi)
__all__.append(symbol)
_import_symbols(locals())
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:14.904367 | import os
import torch
from torch.utils.ffi import create_extension
#this_file = os.path.dirname(__file__)
sources = ['src/roi_crop.c']
headers = ['src/roi_crop.h']
defines = []
with_cuda = False
if torch.cuda.is_available():
print('Including CUDA code.')
sources += ['src/roi_crop_cuda.c']
headers += ['s... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_align/modules/roi_align.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:15.384636 | from torch.nn.modules.module import Module
from torch.nn.functional import avg_pool2d, max_pool2d
from ..functions.roi_align import RoIAlignFunction
class RoIAlign(Module):
def __init__(self, aligned_height, aligned_width, spatial_scale):
super(RoIAlign, self).__init__()
self.aligned_width = int(... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/functions/roi_crop.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:15.580184 | # functions/add.py
import torch
from torch.autograd import Function
from .._ext import roi_crop
import pdb
class RoICropFunction(Function):
def forward(self, input1, input2):
self.input1 = input1.clone()
self.input2 = input2.clone()
output = input2.new(input2.size()[0], input1.size()[1], in... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/functions/gridgen.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:15.776278 | # functions/add.py
import torch
from torch.autograd import Function
import numpy as np
class AffineGridGenFunction(Function):
def __init__(self, height, width,lr=1):
super(AffineGridGenFunction, self).__init__()
self.lr = lr
self.height, self.width = height, width
self.grid = np.ze... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/_ext/crop_resize/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:15.836822 |
from torch.utils.ffi import _wrap_function
from ._crop_resize import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
locals[symbol] = _wrap_function(fn, _ffi)
__all__.append(symbol)
_import_symbols(locals())
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_pooling/_ext/roi_pooling/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:15.988070 |
from torch.utils.ffi import _wrap_function
from ._roi_pooling import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
locals[symbol] = _wrap_function(fn, _ffi)
__all__.append(symbol)
_import_symbols(locals())
|
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_pooling/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:16.213178 | import os
import torch
from torch.utils.ffi import create_extension
sources = ['src/roi_pooling.c']
headers = ['src/roi_pooling.h']
defines = []
with_cuda = False
if torch.cuda.is_available():
print('Including CUDA code.')
sources += ['src/roi_pooling_cuda.c']
headers += ['src/roi_pooling_cuda.h']
de... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_pooling/functions/roi_pool.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:16.404383 | import torch
from torch.autograd import Function
from .._ext import roi_pooling
import pdb
class RoIPoolFunction(Function):
def __init__(ctx, pooled_height, pooled_width, spatial_scale):
ctx.pooled_width = pooled_width
ctx.pooled_height = pooled_height
ctx.spatial_scale = spatial_scale
... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/modules/gridgen.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:20.566588 | from torch.nn.modules.module import Module
import torch
from torch.autograd import Variable
import numpy as np
from ..functions.gridgen import AffineGridGenFunction
import pyximport
pyximport.install(setup_args={"include_dirs":np.get_include()},
reload_support=True)
class _AffineGridGen(Module):
... |
jwyang/fpn.pytorch | https://github.com/jwyang/fpn.pytorch | null | null | null | null | 970 | null | null | mit | null | null | null | null | null | null | null | lib/model/roi_crop/modules/roi_crop.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:20.585958 | from torch.nn.modules.module import Module
from ..functions.roi_crop import RoICropFunction
class _RoICrop(Module):
def __init__(self, layout = 'BHWD'):
super(_RoICrop, self).__init__()
def forward(self, input1, input2):
return RoICropFunction()(input1, input2)
|
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/demo/cli.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.825137 | import json
from demo.infer import LiveCCDemoInfer
if __name__ == '__main__':
model_path = 'chenjoya/LiveCC-7B-Instruct'
video_path = "demo/sources/howto_fix_laptop_mute_1080p.mp4"
query = """Please describe the video."""
infer = LiveCCDemoInfer(model_path=model_path)
state = {'video_path': vi... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/demo/infer.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.830274 | import functools, torch
from liger_kernel.transformers import apply_liger_kernel_to_qwen2_vl
apply_liger_kernel_to_qwen2_vl()
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor, LogitsProcessor, logging, Qwen2_5_VLForConditionalGeneration
from livecc_utils import prepare_multiturn_multimodal_inputs... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/demo/app.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.845789 | import argparse
parser = argparse.ArgumentParser(description="Set runtime flags")
parser.add_argument("--hf_spaces", action="store_true", help="Use this flag if running on Hugging Face Spaces.")
parser.add_argument("--js_monitor", action="store_true", default=True,
help="Whether to use JS-based vid... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.851726 | import transformers
from dataclasses import dataclass, field
@dataclass
class ModelArguments:
pretrained_model_name_or_path: str = ''
freeze_modules: list[str] = field(default_factory=lambda: []) |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/utils/multiprocessor.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.854094 | import tqdm
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
def local_mt(datums: list, func: callable, desc: str = None, num_workers=16):
with ThreadPoolExecutor(max_workers=num_workers) as executor:
if desc is None:
return list(executor.map(func, datums))
return ... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | models.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.854989 | import transformers
from dataclasses import dataclass, field
@dataclass
class ModelArguments:
pretrained_model_name_or_path: str = ''
freeze_modules: list[str] = field(default_factory=lambda: []) |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/debug.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.856218 | import json, tqdm, os, collections
from utils.multiprocessor import local_mt
# Howto & Style, Sports, Education, Autos & Vehicles, Science & Technology, Gaming, News & Politics
# --- filter category ---
def filter_category():
path = 'live_whisperx_30-240s_3.5m.jsonl'
with open(path) as f:
lines = f.re... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/demo/render/bubble.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.865727 | import cv2, textwrap
import numpy as np
from PIL import Image, ImageDraw, ImageFont, ImageFilter
class ResponseBubble:
def __init__(
self,
font_path: str = '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf',
font_size: int = 50,
meta_font_path: str = '/usr/share/fonts/truetype/dejavu... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | baselines/livecc/demo/render/video.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:22.866295 | import json, os, argparse, cv2, torchvision, torch
import soundfile as sf
from pydub import AudioSegment
from PIL import Image
import numpy as np
from kokoro import KPipeline
from demo.render.bubble import ResponseBubble, QueryBubble
from moviepy import VideoFileClip, AudioFileClip, ImageSequenceClip
def parse_args():... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/data/lmm_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.413157 | from dataclasses import dataclass, field
import json, torch, random, tqdm, io, functools,os
from PIL import Image
from torch.utils.data import Dataset
from transformers import logging, AutoProcessor, AutoModel, Qwen2_5_VLForConditionalGeneration
from torchvision.transforms.functional import pil_to_tensor
from transform... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/data/utils/multiprocessor.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.495245 | import tqdm
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
def local_mt(datums: list, func: callable, desc: str = None, num_workers=16):
with ThreadPoolExecutor(max_workers=num_workers) as executor:
if desc is None:
return list(executor.map(func, datums))
return ... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/scripts/auto_run.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.504685 | import argparse
from vlmeval.smp import *
from vlmeval.config import supported_VLM
def is_api(x):
return getattr(supported_VLM[x].func, 'is_api', False)
models = list(supported_VLM)
models = [x for x in models if 'fs' not in x]
models = [x for x in models if not is_api(x)]
exclude_list = ['cogvlm-grounding-genera... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/docs/en/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.505953 | # flake8: noqa
# 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 --------------------------------------------------------... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/scripts/apires_scan.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.507614 | import sys
from vlmeval import *
from vlmeval.dataset import SUPPORTED_DATASETS
FAIL_MSG = 'Failed to obtain answer via API.'
root = sys.argv[1]
if root[-1] in '/\\':
root = root[:-1]
model_name = root.split('/')[-1]
for d in SUPPORTED_DATASETS:
fname = f'{model_name}_{d}.xlsx'
pth = osp.join(root, fname... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/docs/zh-CN/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.508796 | # flake8: noqa
# 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 --------------------------------------------------------... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/.github/scripts/assert_score.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.519393 | import argparse
import ast
import json
import os
import pandas as pd
def validate_scores(dataset_list, assert_score, model_name):
for dataset in dataset_list:
base_score = assert_score[dataset][model_name]
if dataset == "OCRBench_MINI":
score_file = os.path.join("outputs", f"{model_na... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/run.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:23.526837 | import json
import os
import subprocess
from functools import partial
# GET the number of GPUs on the node without importing libs like torch
def get_gpu_list():
CUDA_VISIBLE_DEVICES = os.environ.get('CUDA_VISIBLE_DEVICES', '')
if CUDA_VISIBLE_DEVICES != '':
gpu_list = [int(x) for x in CUDA_VISIBLE_DEV... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/scripts/data_browser.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.214769 | """
pip install gradio # proxy_on first
python vis_geochat_data.py
# browse data in http://127.0.0.1:10064
"""
import os
import io
import json
import copy
import time
import gradio as gr
import base64
from PIL import Image
from io import BytesIO
from argparse import Namespace
# from llava import conversation as con... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/test.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.290467 |
from vlmeval.config import supported_VLM
model = supported_VLM['Qwen2.5-VL-7B-Instruct']()
# 前向单张图片
ret = model.generate(['assets/apple.jpg', 'What is in this image?'])
print(ret) # 这张图片上有一个带叶子的红苹果
# 前向多张图片
ret = model.generate(['assets/apple.jpg', 'assets/apple.jpg', 'How many apples are there in the provided images... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/scripts/mmb_eval_gradio.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.291756 | from vlmeval.smp import *
from vlmeval.tools import EVAL
from vlmeval.dataset import build_dataset
import gradio as gr
HEADER = """
# Welcome to MMBench👏👏
We are delighted that you are willing to submit the evaluation results to the MMBench official website! The evaluation service currently can handle submissions of... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.292755 | import ssl
ssl._create_default_https_context = ssl._create_unverified_context
# Temporarily bypass SSL certificate verification to download files from oss.
try:
import torch
except ImportError:
pass
from .smp import *
load_env()
from .api import *
from .dataset import *
from .utils import *
from .vlm import ... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/bailingmm.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.388812 | import base64
from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import DATASET_TYPE
from vlmeval.smp.vlm import encode_image_file_to_base64
import time
class bailingMMWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
model: str,
retr... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/bluelm_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.396994 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from typing import Iterable, List
import os
import re
import json
def split_think(text: str) -> str:
"""
提取think后的内容
"""
if "</think>" in text:
answer = text.split("</think>")[1]
else:
if "<think>" in text:
... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.422193 | import time
import random as rd
from abc import abstractmethod
import os.path as osp
import copy as cp
from ..smp import get_logger, parse_file, concat_images_vlmeval, LMUDataRoot, md5, decode_base64_to_image_file
class BaseAPI:
allowed_types = ['text', 'image', 'video']
INTERLEAVE = True
INSTALL_REQ = F... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/scripts/summarize.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.577726 | from vlmeval.smp import *
from vlmeval.dataset import SUPPORTED_DATASETS
def get_score(model, dataset):
file_name = f'{model}/{model}_{dataset}'
if listinstr([
'CCBench', 'MMBench', 'SEEDBench_IMG', 'MMMU', 'ScienceQA',
'AI2D_TEST', 'MMStar', 'RealWorldQA', 'BLINK', 'VisOnlyQA-VLMEvalKit'
... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.607638 | import re
import sys
from os.path import exists
from setuptools import find_packages, setup
def parse_requirements(fname='requirements.txt', with_version=True):
"""Parse the package dependencies listed in a requirements file but strips
specific versioning information.
Args:
fname (str): path to r... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.801758 | from .gpt import OpenAIWrapper, GPT4V
from .hf_chat_model import HFChatModel
from .gemini import GeminiWrapper, Gemini
from .qwen_vl_api import QwenVLWrapper, QwenVLAPI, Qwen2VLAPI
from .qwen_api import QwenAPI
from .claude import Claude_Wrapper, Claude3V
from .reka import Reka
from .glm_vision import GLMVisionAPI
from... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/claude.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.820428 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from time import sleep
import base64
import mimetypes
from PIL import Image
alles_url = 'https://openxlab.org.cn/gw/alles-apin-hub/v1/claude/v1/text/chat'
alles_headers = {
'alles-apin-token': '',
'Content-Type': 'application/json'
}
official_url =... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/doubao_vl_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.871844 | from vlmeval.smp import *
import os
import sys
from vlmeval.api.base import BaseAPI
import math
from vlmeval.dataset import DATASET_TYPE
from vlmeval.dataset import img_root_map
from io import BytesIO
import pandas as pd
import requests
import json
import base64
import time
from openai import OpenAI
class DoubaoVLWra... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/gemini.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.885605 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
headers = 'Content-Type: application/json'
class GeminiWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
model: str = 'gemini-1.0-pro',
retry: int = 5,
key: str = None,
... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/cloudwalk.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:24.914042 | from ..smp import *
import os
from .base import BaseAPI
class CWWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
model: str = 'cw-congrong-v2.0',
retry: int = 10,
key: str = None,
verbose: bool = True,
system_prompt... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/hf_chat_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.016822 | import os
import sys
import os.path as osp
import torch
from ..smp import *
def get_gpu_num(model_name):
model_name = model_name.lower()
kws = {
8: ['65b', '70b'],
4: ['30b', '33b', '35b', '40b'],
2: ['13b', '14b', '20b', '8b'],
1: ['6b', '7b', 'moss'],
}
for k in [8, 4... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/glm_vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.023910 | import requests
requests.packages.urllib3.disable_warnings()
from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import DATASET_TYPE
from vlmeval.smp.vlm import encode_image_file_to_base64
class GLMVisionWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/gpt.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.026455 | from ..smp import *
import os
import sys
from .base import BaseAPI
APIBASES = {
'OFFICIAL': 'https://api.openai.com/v1/chat/completions',
}
def GPT_context_window(model):
length_map = {
'gpt-4': 8192,
'gpt-4-0613': 8192,
'gpt-4-turbo-preview': 128000,
'gpt-4-1106-preview': 128... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/hunyuan.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.151827 | from vlmeval.smp import *
import os
import sys
from vlmeval.api.base import BaseAPI
import math
from vlmeval.dataset import DATASET_TYPE
from vlmeval.dataset import img_root_map
from io import BytesIO
import pandas as pd
import requests
import json
import base64
import time
class HunyuanWrapper(BaseAPI):
is_api:... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/jt_vl_chat.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.212889 | import pandas as pd
import requests
import json
import os
import base64
from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import DATASET_TYPE
from vlmeval.dataset import img_root_map
API_ENDPOINT = "https://hl.jiutian.10086.cn/kunlun/ingress/api/hl-4a9c15/7b11a3451e1a4612a6661c3e22235... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/kimivl_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.379976 | from ..smp import *
import os
import sys
from .base import BaseAPI
APIBASES = {
'OFFICIAL': 'http://localhost:8000/v1/chat/completions',
}
def extract_summary(text: str, bot: str = "◁think▷", eot: str = "◁/think▷") -> str:
# 输出截断, 返回空字符串
if bot in text and eot not in text:
return ""
if eot in... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/lmdeploy.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.427832 | # from http import HTTPStatus
import os
import requests
from ..dataset import DATASET_TYPE, DATASET_MODALITY
from vlmeval.api.base import BaseAPI
from vlmeval.smp import *
class InternVL2_PromptUtil:
def __init__(self, use_mpo_prompt=False):
self.use_mpo_prompt = use_mpo_prompt
def dump_image(self, ... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/mug_u.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.451245 | # from http import HTTPStatus
import os
import requests
from ..dataset import DATASET_TYPE, DATASET_MODALITY
from vlmeval.api.base import BaseAPI
from vlmeval.smp import *
class MUGUWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
model: str,
retry: int = 5,
... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/qwen_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.451848 | from http import HTTPStatus
import os
from vlmeval.api.base import BaseAPI
from vlmeval.smp import *
# Note: This is a pure language model API.
class QwenAPI(BaseAPI):
is_api: bool = True
def __init__(self,
model: str = 'qwen-max-1201',
retry: int = 5,
verb... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/qwen_vl_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.467018 | from __future__ import annotations
import os
import warnings
from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.vlm.qwen2_vl.prompt import Qwen2VLPromptMixin
def ensure_image_url(image: str) -> str:
prefixes = ['http://', 'https://', 'file://', 'data:image;']
if any(image.startswith... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/reka.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.579750 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from time import sleep
import mimetypes
class Reka_Wrapper(BaseAPI):
is_api: bool = True
INTERLEAVE: bool = False
def __init__(self,
model: str = 'reka-flash-20240226',
key: str = None,
retr... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/siliconflow.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.600272 | import math
from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import img_root_map
API_BASE = "https://api.siliconflow.cn/v1/chat/completions"
def resize_image(image: Image.Image, max_height: int, max_width: int) -> Image.Image:
width, height = image.size
if min(width, height... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/sensechat_vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.632678 | import os
import string
import time
from typing import Optional
import pandas as pd
import requests
from vlmeval.smp import (
LMUDataRoot,
osp,
read_ok,
decode_base64_to_image_file,
toliststr,
listinstr,
cn_string,
)
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import img_root_m... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/stepai.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.712427 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
url = 'https://api.stepfun.com/v1/chat/completions'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {}',
}
class StepAPI_INT(BaseAPI):
is_api: bool = True
def __init__(self,
model: str = 'step-1... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/taichu.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:25.777499 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
import os
import re
import json
from PIL import Image
import base64
from io import BytesIO
import copy
class ChatResponse(dict):
def __getattr__(self, name):
value = self.get(name)
if isinstance(value, dict):
return ChatRe... |
mit-han-lab/streaming-vlm | https://github.com/mit-han-lab/streaming-vlm | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | streaming_vlm/eval/VLMEvalKit/vlmeval/api/taiyi.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:26.012814 | from vlmeval.smp import *
from vlmeval.api.base import BaseAPI
from vlmeval.dataset import DATASET_TYPE, img_root_map
class TaiyiWrapper(BaseAPI):
is_api: bool = True
def __init__(self,
model: str = 'taiyi',
retry: int = 5,
key: str = None,
... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/configs/cascade_mask_rcnn_vitdet_h_75ep.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.266703 | ## coco_loader_lsj.py
import detectron2.data.transforms as T
from detectron2 import model_zoo
from detectron2.config import LazyCall as L
# Data using LSJ
image_size = 1024
dataloader = model_zoo.get_config("common/data/coco.py").dataloader
dataloader.train.mapper.augmentations = [
L(T.RandomFlip)(horizontal=True... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.269502 | """
This file contains the defition of the base Dataset class.
"""
class DatasetRegistration(type):
"""
Metaclass for registering different datasets
"""
def __init__(cls, name, bases, nmspc):
super().__init__(name, bases, nmspc)
if not hasattr(cls, 'registry'):
cls.registry ... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/json_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.270984 | import copy
import os
import json
import glob
import numpy as np
import torch
from typing import Any, Dict, List
from yacs.config import CfgNode
import braceexpand
import cv2
from .dataset import Dataset
from .utils import get_example, expand_to_aspect_ratio
from .smplh_prob_filter import poses_check_probable, load_am... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.288293 | from typing import Dict, Optional
import torch
import numpy as np
import pytorch_lightning as pl
from yacs.config import CfgNode
import webdataset as wds
from ..configs import to_lower
from .dataset import Dataset
from .image_dataset import ImageDataset
from .mocap_dataset import MoCapDataset
def create_dataset(cfg:... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | eval.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.290131 | import argparse
import os
import json
from pathlib import Path
import traceback
from typing import List, Optional
import pandas as pd
import torch
from filelock import FileLock
from hamer.configs import dataset_eval_config
from hamer.datasets import create_dataset
from hamer.utils import Evaluator, recursive_to
from t... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/image_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.291047 | import copy
import os
import numpy as np
import torch
from typing import Any, Dict, List
from yacs.config import CfgNode
import braceexpand
import cv2
from .dataset import Dataset
from .utils import get_example, expand_to_aspect_ratio
def expand(s):
return os.path.expanduser(os.path.expandvars(s))
def expand_urls... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/configs/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.291578 | import os
from typing import Dict
from yacs.config import CfgNode as CN
CACHE_DIR_HAMER = "./_DATA"
def to_lower(x: Dict) -> Dict:
"""
Convert all dictionary keys to lowercase
Args:
x (dict): Input dictionary
Returns:
dict: Output dictionary with all keys converted to lowercase
"""
... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/mocap_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.321149 | import numpy as np
from typing import Dict
class MoCapDataset:
def __init__(self, dataset_file: str):
"""
Dataset class used for loading a dataset of unpaired MANO parameter annotations
Args:
cfg (CfgNode): Model config file.
dataset_file (str): Path to npz file con... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.377135 | from pathlib import Path
import torch
import argparse
import os
import cv2
import numpy as np
from hamer.configs import CACHE_DIR_HAMER
from hamer.models import HAMER, download_models, load_hamer, DEFAULT_CHECKPOINT
from hamer.utils import recursive_to
from hamer.datasets.vitdet_dataset import ViTDetDataset, DEFAULT_M... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/vitdet_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.879485 | from typing import Dict
import cv2
import numpy as np
from skimage.filters import gaussian
from yacs.config import CfgNode
import torch
from .utils import (convert_cvimg_to_tensor,
expand_to_aspect_ratio,
generate_image_patch_cv2)
DEFAULT_MEAN = 255. * np.array([0.485, 0.456, ... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/datasets/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.891991 | """
Parts of the code are taken or adapted from
https://github.com/mkocabas/EpipolarPose/blob/master/lib/utils/img_utils.py
"""
import torch
import numpy as np
from skimage.transform import rotate, resize
from skimage.filters import gaussian
import random
import cv2
from typing import List, Dict, Tuple
from yacs.config... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/components/pose_transformer.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.905787 | from inspect import isfunction
from typing import Callable, Optional
import torch
from einops import rearrange
from einops.layers.torch import Rearrange
from torch import nn
from .t_cond_mlp import (
AdaptiveLayerNorm1D,
FrequencyEmbedder,
normalization_layer,
)
# from .vit import Attention, FeedForward
... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/backbones/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.929023 | from .vit import vit
def create_backbone(cfg):
if cfg.MODEL.BACKBONE.TYPE == 'vit':
return vit(cfg)
else:
raise NotImplementedError('Backbone type is not implemented')
|
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/discriminator.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.930569 | import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self):
"""
Pose + Shape discriminator proposed in HMR
"""
super(Discriminator, self).__init__()
self.num_joints = 15
# poses_alone
self.D_conv1 = nn.Conv2d(9, 32, kernel_size=1)... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/components/t_cond_mlp.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.967707 | import copy
from typing import List, Optional
import torch
class AdaptiveLayerNorm1D(torch.nn.Module):
def __init__(self, data_dim: int, norm_cond_dim: int):
super().__init__()
if data_dim <= 0:
raise ValueError(f"data_dim must be positive, but got {data_dim}")
if norm_cond_di... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.968844 | from .mano_wrapper import MANO
from .hamer import HAMER
from .discriminator import Discriminator
from ..utils.download import cache_url
from ..configs import CACHE_DIR_HAMER
def download_models(folder=CACHE_DIR_HAMER):
"""Download checkpoints and files for running inference.
"""
import os
os.makedirs... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/hamer.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:28.992066 | import torch
import pytorch_lightning as pl
from typing import Any, Dict, Mapping, Tuple
from yacs.config import CfgNode
from ..utils import SkeletonRenderer, MeshRenderer
from ..utils.geometry import aa_to_rotmat, perspective_projection
from ..utils.pylogger import get_pylogger
from .backbones import create_backbone... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/backbones/vit.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:29.010087 | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch
from functools import partial
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
from timm.models.layers import drop_path, to_2tuple, trunc_normal_
def vit(cfg):
return ViT(
img... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/heads/mano_head.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:29.475712 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import einops
from ...utils.geometry import rot6d_to_rotmat, aa_to_rotmat
from ..components.pose_transformer import TransformerDecoder
def build_mano_head(cfg):
mano_head_type = cfg.MODEL.MANO_HEAD.get('TYPE', 'hamer')
if m... |
geopavlakos/hamer | https://github.com/geopavlakos/hamer | null | null | null | null | 969 | null | null | mit | null | null | null | null | null | null | null | hamer/models/mano_wrapper.py | null | null | null | null | null | null | Python | 2026-05-04T01:39:29.524414 | import torch
import numpy as np
import pickle
from typing import Optional
import smplx
from smplx.lbs import vertices2joints
from smplx.utils import MANOOutput, to_tensor
from smplx.vertex_ids import vertex_ids
class MANO(smplx.MANOLayer):
def __init__(self, *args, joint_regressor_extra: Optional[str] = None, **k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.