repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
CSOgroup/cellcharter
https://github.com/CSOgroup/cellcharter/blob/461165f57ee9ac5614f550d99a82bf01fb086948/tests/plotting/test_plot_nhood.py
tests/plotting/test_plot_nhood.py
import squidpy as sq from squidpy._constants._pkg_constants import Key import cellcharter as cc _CK = "cell type" key = Key.uns.nhood_enrichment(_CK) adata = sq.datasets.imc() sq.gr.spatial_neighbors(adata, coord_type="generic", delaunay=True) cc.gr.remove_long_links(adata) class TestPlotNhoodEnrichment: def t...
python
BSD-3-Clause
461165f57ee9ac5614f550d99a82bf01fb086948
2026-01-05T07:13:12.201168Z
false
CSOgroup/cellcharter
https://github.com/CSOgroup/cellcharter/blob/461165f57ee9ac5614f550d99a82bf01fb086948/tests/plotting/test_shape.py
tests/plotting/test_shape.py
from anndata import AnnData import cellcharter as cc class TestPlotBoundaries: def test_boundaries(self, codex_adata: AnnData): cc.gr.connected_components(codex_adata, cluster_key="cluster_cellcharter", min_cells=250) cc.tl.boundaries(codex_adata) cc.pl.boundaries(codex_adata, sample="BAL...
python
BSD-3-Clause
461165f57ee9ac5614f550d99a82bf01fb086948
2026-01-05T07:13:12.201168Z
false
CSOgroup/cellcharter
https://github.com/CSOgroup/cellcharter/blob/461165f57ee9ac5614f550d99a82bf01fb086948/docs/conf.py
docs/conf.py
# 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 -------------------------------------------------------------- import sy...
python
BSD-3-Clause
461165f57ee9ac5614f550d99a82bf01fb086948
2026-01-05T07:13:12.201168Z
false
CSOgroup/cellcharter
https://github.com/CSOgroup/cellcharter/blob/461165f57ee9ac5614f550d99a82bf01fb086948/docs/extensions/typed_returns.py
docs/extensions/typed_returns.py
# code from https://github.com/theislab/scanpy/blob/master/docs/extensions/typed_returns.py # with some minor adjustment from __future__ import annotations import re from collections.abc import Generator, Iterable from sphinx.application import Sphinx from sphinx.ext.napoleon import NumpyDocstring def _process_retu...
python
BSD-3-Clause
461165f57ee9ac5614f550d99a82bf01fb086948
2026-01-05T07:13:12.201168Z
false
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/prompts.py
text_lloom/src/text_lloom/prompts.py
# Distill - Filter ======================== filter_prompt = """ I have the following TEXT EXAMPLE: {ex} Please extract {n_quotes} QUOTES exactly copied from this EXAMPLE that are {seeding_phrase}. Please respond ONLY with a valid JSON in the following format: {{ "relevant_quotes": [ "<QUOTE_1>", "<QUOTE_2>", ... ]...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
false
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/llm.py
text_lloom/src/text_lloom/llm.py
""" llm.py ------ This file contains utility functions for processing calls to LLMs. """ # IMPORTS ================================ import numpy as np import asyncio # Local imports if __package__ is None or __package__ == '': # uses current directory visibility from llm_openai import * else: # uses curre...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
false
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/concept_induction.py
text_lloom/src/text_lloom/concept_induction.py
# Main concept induction library functions # ================================================= # Imports import yaml import pandas as pd from pandas.api.types import is_string_dtype, is_numeric_dtype import time from tqdm.asyncio import tqdm_asyncio import numpy as np import math import json import uuid import sys imp...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
true
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/llm_openai.py
text_lloom/src/text_lloom/llm_openai.py
# OpenAI custom functions import tiktoken import numpy as np # SETUP functions def setup_llm_fn(api_key): from openai import AsyncOpenAI llm_client = AsyncOpenAI( api_key=api_key, ) return llm_client def setup_embed_fn(api_key): from openai import OpenAI embed_client = OpenAI...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
false
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/concept.py
text_lloom/src/text_lloom/concept.py
# Concept induction concept functions # ================================================= # Imports import uuid # CONCEPT class ================================ class Concept: def __init__(self, name, prompt, example_ids, active, summary=None, seed=None): concept_id = str(uuid.uuid4()) self.id = c...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
false
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/workbench.py
text_lloom/src/text_lloom/workbench.py
# Concept induction session functions # ================================================= # Imports import time import pandas as pd import random from nltk.tokenize import sent_tokenize import os from yaspin import yaspin import base64 import requests import nltk nltk.download('punkt_tab', quiet=True) # Local import...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
true
michelle123lam/lloom
https://github.com/michelle123lam/lloom/blob/8252533ab6018bea89c1e33e31c0f8fb6a07a707/text_lloom/src/text_lloom/__init__.py
text_lloom/src/text_lloom/__init__.py
import importlib.metadata import pathlib import anywidget import traitlets try: __version__ = importlib.metadata.version("text_lloom") except importlib.metadata.PackageNotFoundError: __version__ = "unknown" _DEV = False # switch to False for production if _DEV: # from `npx vite` ESM = "http://localhost:...
python
BSD-3-Clause
8252533ab6018bea89c1e33e31c0f8fb6a07a707
2026-01-05T07:14:24.087118Z
false
moranzcw/Zhihu-Spider
https://github.com/moranzcw/Zhihu-Spider/blob/2ea103182a539805b5b4fce1e2e1733bee6a81fd/spider/run.py
spider/run.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Description - 实现多线程,主线程和若干工作线程。 - 主线程:维护一个已爬取用户的set,用于去重;从响应队列中取出关注用户的列表,去重后放入任务队列。 - 工作线程:从任务队列获取url token,爬取用户信息后,存入csv文件;并生成响应信息放入响应队列。 Info - author : "moran" - github : "moranzcw@gmail.com" - date : "2017.7.24" """ import time import os import json from threadin...
python
MIT
2ea103182a539805b5b4fce1e2e1733bee6a81fd
2026-01-05T07:14:20.355630Z
false
moranzcw/Zhihu-Spider
https://github.com/moranzcw/Zhihu-Spider/blob/2ea103182a539805b5b4fce1e2e1733bee6a81fd/spider/crawl.py
spider/crawl.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Description - 获取指定知乎用户的主页,并提取出个人信息。 - 类Crawl为单例模式,在程序中只有一个实例。 - 线程安全。 Required - requests - bs4 (Beautiful Soup) Info - author : "moran" - github : "moranzcw@gmail.com" - date : "2017.7.27" """ import requests from bs4 import BeautifulSoup import json import proxy _...
python
MIT
2ea103182a539805b5b4fce1e2e1733bee6a81fd
2026-01-05T07:14:20.355630Z
false
moranzcw/Zhihu-Spider
https://github.com/moranzcw/Zhihu-Spider/blob/2ea103182a539805b5b4fce1e2e1733bee6a81fd/spider/datafile.py
spider/datafile.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Description - 将知乎用户的个人信息json存储到csv文件中。 - 实现了一些必要的功能: - 从已有的csv文件中提取出所有用户,用于程序中断后重启时加载已爬取用户列表。 - 从已有的csv文件中提取指定数目的未爬取用户,用于程序中断后重启时生成任务队列。 - 类DataFile为单例模式,在程序中只有一个实例。 - 线程安全。 Info - author: "moran" - github: "moranzcw@gmail.com" - date: "2017.7.24" """ import th...
python
MIT
2ea103182a539805b5b4fce1e2e1733bee6a81fd
2026-01-05T07:14:20.355630Z
false
moranzcw/Zhihu-Spider
https://github.com/moranzcw/Zhihu-Spider/blob/2ea103182a539805b5b4fce1e2e1733bee6a81fd/spider/proxy.py
spider/proxy.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Description - 获取IP代理。 Info - author : "moran" - github : "moranzcw@gmail.com" - date : "2017.7.29" """ __author__ = """\ /\/\ ___ _ __ __ _ _ __ / \ / _ \| '__/ _` | '_ \ / /\/\ \ (_) | | | (_| | | | | \/ \/\___/|_| \__,_|_| |_|""" # 代理服务器 proxyHost ...
python
MIT
2ea103182a539805b5b4fce1e2e1733bee6a81fd
2026-01-05T07:14:20.355630Z
false
moranzcw/Zhihu-Spider
https://github.com/moranzcw/Zhihu-Spider/blob/2ea103182a539805b5b4fce1e2e1733bee6a81fd/analysis/datawash.py
analysis/datawash.py
import csv import sys import os.path import json # 清洗数据,去除重复记录。 def washdata(): """清洗数据,去除重复记录。 """ CUR_PATH = sys.path[0] if CUR_PATH == '': CUR_PATH = os.getcwd() DATAPATH = os.path.join(os.path.dirname(CUR_PATH), 'datafile') # 此脚本文件上一级路径中的datafile文件夹 DATA_TABLEHEADER = ['user_url_to...
python
MIT
2ea103182a539805b5b4fce1e2e1733bee6a81fd
2026-01-05T07:14:20.355630Z
false
marcoslucianops/DeepStream-Yolo-Pose
https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/2fa5bd8d6f5f1b388c698c56d1887b8302d56597/deepstream.py
deepstream.py
import gi gi.require_version("Gst", "1.0") from gi.repository import Gst, GLib import os import sys import time import argparse import platform from threading import Lock from ctypes import sizeof, c_float sys.path.append("/opt/nvidia/deepstream/deepstream/lib") import pyds MAX_ELEMENTS_IN_DISPLAY_META = 16 SOURCE ...
python
MIT
2fa5bd8d6f5f1b388c698c56d1887b8302d56597
2026-01-05T07:14:40.094298Z
false
marcoslucianops/DeepStream-Yolo-Pose
https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/2fa5bd8d6f5f1b388c698c56d1887b8302d56597/utils/export_yolonas_pose.py
utils/export_yolonas_pose.py
import os import onnx import torch import torch.nn as nn from super_gradients.training import models class DeepStreamOutput(nn.Module): def __init__(self): super().__init__() def forward(self, x): boxes = x[0] scores = x[1] b, c = boxes.shape[:2] kpts = torch.cat([x[2...
python
MIT
2fa5bd8d6f5f1b388c698c56d1887b8302d56597
2026-01-05T07:14:40.094298Z
false
marcoslucianops/DeepStream-Yolo-Pose
https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/2fa5bd8d6f5f1b388c698c56d1887b8302d56597/utils/export_yoloV7_pose.py
utils/export_yoloV7_pose.py
import os import onnx import torch import torch.nn as nn import models from models.experimental import attempt_load from utils.activations import Hardswish, SiLU class DeepStreamOutput(nn.Module): def __init__(self): super().__init__() def forward(self, x): x = x[0] boxes = x[:, :, :...
python
MIT
2fa5bd8d6f5f1b388c698c56d1887b8302d56597
2026-01-05T07:14:40.094298Z
false
marcoslucianops/DeepStream-Yolo-Pose
https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/2fa5bd8d6f5f1b388c698c56d1887b8302d56597/utils/export_yoloV8_pose.py
utils/export_yoloV8_pose.py
import os import sys import onnx import torch import torch.nn as nn from copy import deepcopy from ultralytics import YOLO from ultralytics.nn.modules import C2f, Detect, RTDETRDecoder import ultralytics.utils import ultralytics.models.yolo import ultralytics.utils.tal as _m sys.modules["ultralytics.yolo"] = ultralyt...
python
MIT
2fa5bd8d6f5f1b388c698c56d1887b8302d56597
2026-01-05T07:14:40.094298Z
false
marcoslucianops/DeepStream-Yolo-Pose
https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/2fa5bd8d6f5f1b388c698c56d1887b8302d56597/utils/export_yolo11_pose.py
utils/export_yolo11_pose.py
import os import sys import onnx import torch import torch.nn as nn from copy import deepcopy from ultralytics import YOLO from ultralytics.nn.modules import C2f, Detect, RTDETRDecoder import ultralytics.utils import ultralytics.models.yolo import ultralytics.utils.tal as _m sys.modules["ultralytics.yolo"] = ultralyt...
python
MIT
2fa5bd8d6f5f1b388c698c56d1887b8302d56597
2026-01-05T07:14:40.094298Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/setup.py
setup.py
# Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import platform import shutil import sys import warnings from setuptools import find_packages, setup def readme(): with open('README.md', encoding='utf-8') as f: content = f.read() return content version_file = 'mmseg/ve...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/tools/train.py
tools/train.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/tools/train.py ''' import argparse import copy import os import os.path as osp import time from datetime import datetime import warnings import mmcv import torch from torch import nn from mmcv.cnn.utils import revert_sync_batchnor...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/tools/get_flops_fps.py
tools/get_flops_fps.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/tools/get_flops.py ''' import argparse from mmcv import Config from mmcv.cnn import get_model_complexity_info from mmseg.models import build_segmentor import torch import warnings warnings.filterwarnings('ignore') def fps_param...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/tools/test.py
tools/test.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/tools/test.py ''' import argparse import os import os.path as osp import shutil import time import warnings import mmcv import torch from mmcv.cnn.utils import revert_sync_batchnorm from mmcv.parallel import MMDataParallel, MMDist...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/version.py
mmseg/version.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/version.py ''' __version__ = '0.29.1' def parse_version_info(version_str): version_info = [] for x in version_str.split('.'): if x.isdigit(): version_info.append(int(x)) elif x.find('rc'...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/__init__.py
mmseg/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/__init__.py ''' import warnings import mmcv from packaging.version import parse from .version import __version__, version_info MMCV_MIN = '1.3.13' MMCV_MAX = '1.8.0' def digit_version(version_str: str, length: int = 4): ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/dataset_wrappers.py
mmseg/datasets/dataset_wrappers.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/dataset_warppers.py ''' import bisect import collections import copy from itertools import chain import mmcv import numpy as np from mmcv.utils import build_from_cfg, print_log from torch.utils.data.dataset import C...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/cityscapes.py
mmseg/datasets/cityscapes.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/cityscapes.py ''' import os.path as osp import mmcv import numpy as np from mmcv.utils import print_log from PIL import Image from .builder import DATASETS from .custom import CustomDataset @DATASETS.register_mod...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/__init__.py
mmseg/datasets/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/__inti__.py ''' from .cityscapes import CityscapesDataset,CityscapesDataset_boundary from .camvid import CamVidDataset,CamVidDataset_boundary from .pascal_context import PascalContextDataset,PascalContextDataset59,P...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pascal_context.py
mmseg/datasets/pascal_context.py
# Copyright (c) OpenMMLab. All rights reserved. ''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pascal_context.py ''' import os.path as osp from .builder import DATASETS from .custom import CustomDataset @DATASETS.register_module() class PascalContextDataset(Cu...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/builder.py
mmseg/datasets/builder.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/ade.py ''' import copy import platform import random from functools import partial import numpy as np import torch from mmcv.parallel import collate from mmcv.runner import get_dist_info from mmcv.utils import Regis...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/camvid.py
mmseg/datasets/camvid.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/cityscapes.py ''' import os.path as osp import mmcv import numpy as np from mmcv.utils import print_log from PIL import Image from .builder import DATASETS from .custom import CustomDataset @DATASETS.register_mod...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/custom.py
mmseg/datasets/custom.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/custom.py ''' import os.path as osp import warnings from collections import OrderedDict import mmcv import numpy as np from mmcv.utils import print_log from prettytable import PrettyTable from torch.utils.data impor...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/compose.py
mmseg/datasets/pipelines/compose.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/compose.py ''' import collections from mmcv.utils import build_from_cfg from ..builder import PIPELINES @PIPELINES.register_module() class Compose(object): """Compose multiple transforms sequentiall...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/formating.py
mmseg/datasets/pipelines/formating.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/formating.py ''' import warnings from .formatting import * warnings.warn('DeprecationWarning: mmseg.datasets.pipelines.formating will be ' 'deprecated in 2021, please replace it with ' ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/loading.py
mmseg/datasets/pipelines/loading.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/loading.py ''' import os.path as osp import mmcv import numpy as np import scipy.io as sio from ..builder import PIPELINES @PIPELINES.register_module() class LoadImageFromFile(object): """Load an im...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/__init__.py
mmseg/datasets/pipelines/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/__init__.py ''' from .compose import Compose from .formatting import (Collect, ImageToTensor, ToDataContainer, ToTensor, Transpose, to_tensor) from .loading import LoadAnnotations, ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/test_time_aug.py
mmseg/datasets/pipelines/test_time_aug.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/test_time_aug.py ''' import warnings import mmcv from ..builder import PIPELINES from .compose import Compose @PIPELINES.register_module() class MultiScaleFlipAug(object): """Test-time augmentation ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/transforms.py
mmseg/datasets/pipelines/transforms.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/transforms.py ''' import copy import mmcv import numpy as np from mmcv.utils import deprecated_api_warning, is_tuple_of from numpy import random from ..builder import PIPELINES @PIPELINES.register_modul...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
true
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/datasets/pipelines/formatting.py
mmseg/datasets/pipelines/formatting.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/datasets/pipelines/formatting.py ''' from collections.abc import Sequence import mmcv import numpy as np import torch from mmcv.parallel import DataContainer as DC from ..builder import PIPELINES def to_tensor(data): ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/__init__.py
mmseg/models/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/__init__.py ''' from .backbones import * # noqa: F401,F403 from .builder import (BACKBONES, HEADS, LOSSES, SEGMENTORS, build_backbone, build_head, build_loss, build_segmentor) from .decode_heads ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/builder.py
mmseg/models/builder.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/builder.py ''' import warnings from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.cnn.bricks.registry import ATTENTION as MMCV_ATTENTION from mmcv.utils import Registry MODELS = Registry('models', parent=MMCV_MODEL...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/accuracy.py
mmseg/models/losses/accuracy.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/accuracy.py ''' import torch.nn as nn def accuracy(pred, target, topk=1, thresh=None, ignore_index=None): """Calculate accuracy according to the prediction and target. Args: pred (torch.Tensor)...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/cross_entropy_loss.py
mmseg/models/losses/cross_entropy_loss.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/cross_entropy_loss.py ''' import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES from .utils import get_class_weight, weight_reduce_loss def customsoftmax(inp, multihotm...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/focal_loss.py
mmseg/models/losses/focal_loss.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/focal_loss.py ''' import torch import torch.nn as nn import torch.nn.functional as F from mmcv.ops import sigmoid_focal_loss as _sigmoid_focal_loss from ..builder import LOSSES from .utils import weight_reduce_l...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/utils.py
mmseg/models/losses/utils.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/utils.py ''' import functools import mmcv import numpy as np import torch.nn.functional as F def get_class_weight(class_weight): """Get class weight for loss function. Args: class_weight (list...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/dice_loss.py
mmseg/models/losses/dice_loss.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/dice.py ''' import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES from .utils import get_class_weight, weighted_loss @weighted_loss def dice_loss(pred, t...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/__init__.py
mmseg/models/losses/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/__init__.py ''' from .accuracy import Accuracy, accuracy,accuracy_se from .cross_entropy_loss import (CrossEntropyLoss, ML_BCELoss, L1_loss,NLL_loss, binary_cross_entropy, cross_e...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/losses/lovasz_loss.py
mmseg/models/losses/lovasz_loss.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/losses/lovasz_loss.py ''' import mmcv import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES from .utils import get_class_weight, weight_reduce_loss def lovasz_grad(gt_sorted...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/decode_heads/aff_head.py
mmseg/models/decode_heads/aff_head.py
''' This file is modified from: https://github.com/dongbo811/AFFormer/blob/main/mmseg/models/decode_heads/aff_head.py ''' from mmcv.cnn import ConvModule from mmseg.ops import resize from ..builder import HEADS from .decode_head import BaseDecodeHead from mmseg.models.utils import * @HEADS.register_module() class CLS...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/decode_heads/__init__.py
mmseg/models/decode_heads/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/decode_heads/__init__.py ''' from .decode_head import BaseDecodeHead from .MS_head import RefineHead,BoundaryHead from .aff_head import CLS __all__ = ['CLS', 'BaseDecodeHead','RefineHead','BoundaryHead']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/decode_heads/decode_head.py
mmseg/models/decode_heads/decode_head.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/decode_head.py ''' from abc import ABCMeta, abstractmethod import torch import torch.nn as nn from mmcv.runner import BaseModule, auto_fp16, force_fp32 from mmseg.core import build_pixel_sampler from mmseg.ops import ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/decode_heads/MS_head.py
mmseg/models/decode_heads/MS_head.py
''' # File: MS_head.py # Author: Youqi Liao # Affiliate: Wuhan University # Date: Jan 21, 2024 # Description: Head for Mobile-Seed (AFD included) ''' import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from torch import einsum from mmseg.ops import resize from ..builder...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/segmentors/cascade_encoder_decoder.py
mmseg/models/segmentors/cascade_encoder_decoder.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/segmentors/cascade_encoder_decoder.py ''' from torch import nn from mmseg.core import add_prefix from mmseg.ops import resize from .. import builder from ..builder import SEGMENTORS from .encoder_decoder import Encoder...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/segmentors/encoder_decoder_refine.py
mmseg/models/segmentors/encoder_decoder_refine.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/segmentors/encoder_decoder.py ''' import torch import time from torch import nn #from ..decode_heads.lpls_utils import Lap_Pyramid_Conv from mmseg.core import add_prefix from mmseg.ops import resize from .. import build...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/segmentors/__init__.py
mmseg/models/segmentors/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/segmentors/__init__.py ''' from .base import BaseSegmentor from .cascade_encoder_decoder import CascadeEncoderDecoder from .encoder_decoder import EncoderDecoder,EncoderDecoder_edge from .encoder_decoder_refine import E...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/segmentors/base.py
mmseg/models/segmentors/base.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/segmentors/base.py ''' import warnings from abc import ABCMeta, abstractmethod from collections import OrderedDict import mmcv import numpy as np import torch import torch.distributed as dist from mmcv.runner import Ba...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/segmentors/encoder_decoder.py
mmseg/models/segmentors/encoder_decoder.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/segmentors/encoder_decoder.py ''' import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from mmseg.core import add_prefix from mmseg.ops import resize from .. import builder from ..build...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/utils/__init__.py
mmseg/models/utils/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/utils/__init__.py ''' from .res_layer import ResLayer __all__ = [ 'ResLayer' ]
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/utils/res_layer.py
mmseg/models/utils/res_layer.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/utils/res_layer.py ''' from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import Sequential from torch import nn as nn class ResLayer(Sequential): """ResLayer to build ResNet style backbone....
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/backbones/afformer_for_MS.py
mmseg/models/backbones/afformer_for_MS.py
''' This file is modified from: https://github.com/dongbo811/AFFormer/blob/main/tools/afformer.py NOTE: `AFFormer_for_MS` is identical to the `AFFormer` except return multi-scale features. ''' import torch from torch import einsum, nn import torch.nn.functional as F import torch.nn as nn from functools import partial...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/backbones/afformer.py
mmseg/models/backbones/afformer.py
''' This file is modified from: https://github.com/dongbo811/AFFormer/blob/main/tools/afformer.py ''' import torch from torch import einsum, nn import torch.nn.functional as F import torch.nn as nn from functools import partial import math import numpy as np from einops import rearrange from timm.models.layers import ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/backbones/__init__.py
mmseg/models/backbones/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/backbone/__init__.py ''' from .afformer_for_MS import AFFormer_for_MS_base,AFFormer_for_MS_small,AFFormer_for_MS_tiny from .afformer import afformer_base,afformer_small,afformer_tiny all = [ 'afformer_base', 'afforme...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/necks/__init__.py
mmseg/models/necks/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/necks/__init__.py ''' from .fpn import FPN __all__ = ['FPN']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/models/necks/fpn.py
mmseg/models/necks/fpn.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/model/necks/fpn.py ''' import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule, auto_fp16 from mmseg.ops import resize from ..builder import NECKS @NECKS.reg...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/utils/logger.py
mmseg/utils/logger.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/utils/logger.py ''' import logging from mmcv.utils import get_logger def get_root_logger(log_file=None, log_level=logging.INFO): """Get the root logger. The logger will be initialized if it has not been initialize...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/utils/collect_env.py
mmseg/utils/collect_env.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/utils/colect_env.py ''' from mmcv.utils import collect_env as collect_base_env from mmcv.utils import get_git_hash import mmseg def collect_env(): """Collect the information of the running environments.""" env_info...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/utils/misc.py
mmseg/utils/misc.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/utils/misc.py ''' import glob import os.path as osp import warnings def find_latest_checkpoint(path, suffix='pth'): """This function is for finding the latest checkpoint. It will be used when automatically resume, ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/utils/__init__.py
mmseg/utils/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/utils/__init__.py ''' from .collect_env import collect_env from .logger import get_root_logger from .misc import find_latest_checkpoint from .set_env import setup_multi_processes __all__ = [ 'get_root_logger', 'collect_e...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/utils/set_env.py
mmseg/utils/set_env.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/utils/set_env.py ''' import os import platform import cv2 import torch.multiprocessing as mp from ..utils import get_root_logger def setup_multi_processes(cfg): """Setup multi-processing environment variables.""" ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/__init__.py
mmseg/core/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .evaluation import * # noqa: F401, F403 from .seg import * # noqa: F401, F403 from .utils import * # noqa: F401, F403
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/utils/misc.py
mmseg/core/utils/misc.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/utils/misc.py ''' def add_prefix(inputs, prefix): """Add prefix for dict. Args: inputs (dict): The input dict with str keys. prefix (str): The prefix to add. Returns: dict: The dict...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/utils/__init__.py
mmseg/core/utils/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/utils/__init__.py ''' from .misc import add_prefix __all__ = ['add_prefix']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/seg/__init__.py
mmseg/core/seg/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/seg/__init__.py ''' from .builder import build_pixel_sampler from .sampler import BasePixelSampler, OHEMPixelSampler __all__ = ['build_pixel_sampler', 'BasePixelSampler', 'OHEMPixelSampler']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/seg/builder.py
mmseg/core/seg/builder.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/seg/builder.py ''' from mmcv.utils import Registry, build_from_cfg PIXEL_SAMPLERS = Registry('pixel sampler') def build_pixel_sampler(cfg, **default_args): """Build pixel sampler for segmentation map.""" retur...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/seg/sampler/base_pixel_sampler.py
mmseg/core/seg/sampler/base_pixel_sampler.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/seg/sampler/base_pixel_smaplesr.py ''' from abc import ABCMeta, abstractmethod class BasePixelSampler(metaclass=ABCMeta): """Base class of pixel sampler.""" def __init__(self, **kwargs): pass @abs...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/seg/sampler/ohem_pixel_sampler.py
mmseg/core/seg/sampler/ohem_pixel_sampler.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/seg/sampler/ohem_pixel_smaplesr.py ''' import torch import torch.nn as nn import torch.nn.functional as F from ..builder import PIXEL_SAMPLERS from .base_pixel_sampler import BasePixelSampler @PIXEL_SAMPLERS.register_...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/seg/sampler/__init__.py
mmseg/core/seg/sampler/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/seg/sampler/__init__.py ''' from .base_pixel_sampler import BasePixelSampler from .ohem_pixel_sampler import OHEMPixelSampler __all__ = ['BasePixelSampler', 'OHEMPixelSampler']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/evaluation/metrics.py
mmseg/core/evaluation/metrics.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/evaluation/metrics.py ''' from collections import OrderedDict import mmcv import numpy as np import torch def f_score(precision, recall, beta=1): """calculate the f-score value. Args: precision (float...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/evaluation/IOU_boundary.py
mmseg/core/evaluation/IOU_boundary.py
""" This file is modified from: https://github.com/nv-tlabs/GSCNN/blob/master/utils/f_boundary.py and modified from: https://github.com/bowenc0221/boundary-iou-api/blob/master/boundary_iou/utils/boundary_utils.py Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (h...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/evaluation/class_names.py
mmseg/core/evaluation/class_names.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/evaluation/class_names.py ''' import mmcv def cityscapes_classes(): """Cityscapes class names for external use.""" return [ 'road', 'sidewalk', 'building', 'wall', 'fence', 'pole', 'traffic ligh...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/evaluation/__init__.py
mmseg/core/evaluation/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/apis/train.py ''' from .class_names import get_classes, get_palette from .eval_hooks import DistEvalHook, EvalHook from .metrics import (eval_metrics, intersect_and_union, mean_dice, mean_fscore, mean_io...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/core/evaluation/eval_hooks.py
mmseg/core/evaluation/eval_hooks.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/core/evaluation/eval_hooks.py ''' import os.path as osp import warnings import torch.distributed as dist from mmcv.runner import DistEvalHook as _DistEvalHook from mmcv.runner import EvalHook as _EvalHook from torch.nn.modul...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/apis/train.py
mmseg/apis/train.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/apis/train.py ''' import random import warnings import mmcv import numpy as np import torch import torch.distributed as dist from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import HOOKS, ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/apis/inference.py
mmseg/apis/inference.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/apis/inference.py ''' import matplotlib.pyplot as plt import cv2 import mmcv import torch from mmcv.parallel import collate, scatter from mmcv.runner import load_checkpoint from mmseg.datasets.pipelines import Compose from m...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/apis/__init__.py
mmseg/apis/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .inference import inference_segmentor, init_segmentor, show_result_pyplot from .test import multi_gpu_test, single_gpu_test from .train import (get_root_logger, init_random_seed, set_random_seed, train_segmentor) __all__ = [ 'get_root_logger'...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/apis/test.py
mmseg/apis/test.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/apis/test.py ''' import os import os.path as osp import tempfile import warnings from skimage import io import mmcv import numpy as np import torch from mmcv.engine import collect_results_cpu, collect_results_gpu from mmcv.i...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/ops/wrappers.py
mmseg/ops/wrappers.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/ops/wrappers.py ''' import warnings import torch.nn as nn import torch.nn.functional as F def resize(input, size=None, scale_factor=None, mode='nearest', align_corners=None, ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/ops/encoding.py
mmseg/ops/encoding.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/ops/encoding.py ''' import torch from torch import nn from torch.nn import functional as F class Encoding(nn.Module): """Encoding Layer: a learnable residual encoder. Input is of shape (batch_size, channels, heigh...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/mmseg/ops/__init__.py
mmseg/ops/__init__.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/ops/__init__.py ''' from .encoding import Encoding from .wrappers import Upsample, resize __all__ = ['Upsample', 'resize', 'Encoding']
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/data_preprocess/camvid_pascal_preprocess/label_generator.py
data_preprocess/camvid_pascal_preprocess/label_generator.py
import cv2 import numpy as np import os from glob import glob from tqdm import tqdm import argparse Camvid_colorlist = [[0, 128, 192], [128, 0, 0], [64, 0, 128], [192, 192, 128], [64, 64, 128], [64, 64, 0], [128, 64, 128], [0, 0, 192], [192, 128, 128], ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/data_preprocess/cityscapes-preprocess/code/createTrainIdLabelImgs.py
data_preprocess/cityscapes-preprocess/code/createTrainIdLabelImgs.py
#!/usr/bin/python # # Converts the polygonal annotations of the Cityscapes dataset # to images, where pixel values encode ground truth classes. # # The Cityscapes downloads already include such images # a) *color.png : the class is encoded by its color # b) *labelIds.png : the class is encoded ...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/default_runtime.py
configs/_base_/default_runtime.py
# yapf:disable log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook', by_epoch=False), # dict(type='TensorboardLoggerHook',by_epoch=False) ]) # yapf:enable dist_params = dict(backend='nccl') log_level = 'INFO' load_from = None resume_from = None workflow = [('train', 1)] cudnn_b...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/schedules/schedule_20k.py
configs/_base_/schedules/schedule_20k.py
# optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) # runtime settings runner = dict(type='IterBasedRunner', max_iters=20000) checkpoint_config = dict(by_epoch=False, inte...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/schedules/schedule_40k.py
configs/_base_/schedules/schedule_40k.py
# optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) # runtime settings runner = dict(type='IterBasedRunner', max_iters=40000) checkpoint_config = dict(by_epoch=False, inte...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/schedules/schedule_160k.py
configs/_base_/schedules/schedule_160k.py
# optimizer optimizer = dict(type='SGD', lr=2.5e-4, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=1e-6, by_epoch=False) # runtime settings runner = dict(type='IterBasedRunner', max_iters=160000) checkpoint_config = dict(by_epoch=False, i...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/schedules/schedule_80k.py
configs/_base_/schedules/schedule_80k.py
# optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) # runtime settings runner = dict(type='IterBasedRunner', max_iters=80000) checkpoint_config = dict(by_epoch=False, inte...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/datasets/pascal_context_59_boundary.py
configs/_base_/datasets/pascal_context_59_boundary.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/configs/_base_/datasets/pascal_context_59.py ''' # dataset settings dataset_type = 'PascalContextDataset59_boundary' data_root = '../data/VOCdevkit/VOC2010/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57....
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false
WHU-USI3DV/Mobile-Seed
https://github.com/WHU-USI3DV/Mobile-Seed/blob/e9af36ea9ac9dac5506880096cd38423dc3dbf51/configs/_base_/datasets/cityscapes_512x1024.py
configs/_base_/datasets/cityscapes_512x1024.py
''' This file is modified from: https://github.com/open-mmlab/mmsegmentation/blob/master/configs/_base_/datasets/cityscapes_1024x1024.py ''' _base_ = './cityscapes.py' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) crop_size = (512, 512) train_pipeline = [ dict(ty...
python
BSD-2-Clause
e9af36ea9ac9dac5506880096cd38423dc3dbf51
2026-01-05T07:13:30.482047Z
false