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
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/policy/linear.py
sarl_star_ros/CrowdNav/crowd_sim/envs/policy/linear.py
import numpy as np from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY class Linear(Policy): def __init__(self): super().__init__() self.trainable = False self.kinematics = 'holonomic' self.multiagent_training = True def configure(s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/policy/policy_factory.py
sarl_star_ros/CrowdNav/crowd_sim/envs/policy/policy_factory.py
from crowd_sim.envs.policy.linear import Linear from crowd_sim.envs.policy.orca import ORCA def none_policy(): return None policy_factory = dict() policy_factory['linear'] = Linear policy_factory['orca'] = ORCA policy_factory['none'] = none_policy
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/train.py
sarl_star_ros/CrowdNav/crowd_nav/train.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import sys import logging import argparse import configparser import os import shutil import torch import gym import git from crowd_sim.envs.utils.robot import Robot from crowd_nav.utils.trainer ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/__init__.py
sarl_star_ros/CrowdNav/crowd_nav/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/test.py
sarl_star_ros/CrowdNav/crowd_nav/test.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../') import logging import argparse import configparser import os import torch import numpy as np import gy...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/utils/memory.py
sarl_star_ros/CrowdNav/crowd_nav/utils/memory.py
from torch.utils.data import Dataset # memory: list(state,value) class ReplayMemory(Dataset): def __init__(self, capacity): self.capacity = capacity self.memory = list() self.position = 0 def push(self, item): # replace old experience with new experience if len(self.me...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/utils/plot.py
sarl_star_ros/CrowdNav/crowd_nav/utils/plot.py
import re import argparse import matplotlib.pyplot as plt import numpy as np def running_mean(x, n): cumsum = np.cumsum(np.insert(x, 0, 0)) return (cumsum[n:] - cumsum[:-n]) / float(n) def main(): parser = argparse.ArgumentParser() parser.add_argument('log_files', type=str, nargs='+') parser.add...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/utils/trainer.py
sarl_star_ros/CrowdNav/crowd_nav/utils/trainer.py
from __future__ import division import logging import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader class Trainer(object): def __init__(self, model, memory, device, batch_size): """ Train the trainable model of a policy ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/utils/__init__.py
sarl_star_ros/CrowdNav/crowd_nav/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/utils/explorer.py
sarl_star_ros/CrowdNav/crowd_nav/utils/explorer.py
from __future__ import division import logging import copy import torch import numpy as np from crowd_sim.envs.utils.info import * class Explorer(object): def __init__(self, env, robot, device, memory=None, gamma=None, target_policy=None): self.env = env self.robot = robot self.robot_path_...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/configs/__init__.py
sarl_star_ros/CrowdNav/crowd_nav/configs/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/lstm_rl.py
sarl_star_ros/CrowdNav/crowd_nav/policy/lstm_rl.py
import torch import torch.nn as nn import numpy as np import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork1(nn.Module): def __init__(self, input_dim, self_state_dim, mlp_dims, lstm_hidden_dim): super().__init__() self.sel...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/sarl.py
sarl_star_ros/CrowdNav/crowd_nav/policy/sarl.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import numpy as np import torch import torch.nn as nn from torch.nn.functional import softmax import logging from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_nav.policy.cadr...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/cadrl.py
sarl_star_ros/CrowdNav/crowd_nav/policy/cadrl.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import torch import torch.nn as nn import numpy as np import itertools import logging from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionRot, ActionXY f...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/__init__.py
sarl_star_ros/CrowdNav/crowd_nav/policy/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/multi_human_rl.py
sarl_star_ros/CrowdNav/crowd_nav/policy/multi_human_rl.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import torch import numpy as np from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_nav.policy.cadrl import CADRL class MultiHumanRL(CADRL): def __init__(self): s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_nav/policy/policy_factory.py
sarl_star_ros/CrowdNav/crowd_nav/policy/policy_factory.py
from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_nav.policy.cadrl import CADRL from crowd_nav.policy.lstm_rl import LstmRL from crowd_nav.policy.sarl import SARL policy_factory['cadrl'] = CADRL policy_factory['lstm_rl'] = LstmRL policy_factory['sarl'] = SARL
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/train.py
code/train.py
import time import matplotlib import matplotlib.pyplot as plt import torch from torch import nn from torch import optim from config import * from data import DGLREDataset, DGLREDataloader, BERTDGLREDataset from models.GAIN import GAIN_GloVe, GAIN_BERT from test import test from utils import Accuracy, get_cuda, loggin...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/utils.py
code/utils.py
from datetime import datetime import numpy as np import torch def get_cuda(tensor): if torch.cuda.is_available(): return tensor.cuda() return tensor def logging(s): print(datetime.now(), s) class Accuracy(object): def __init__(self): self.correct = 0 self.total = 0 de...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/config.py
code/config.py
import argparse import json import os import numpy as np data_dir = '../data/' prepro_dir = os.path.join(data_dir, 'prepro_data/') if not os.path.exists(prepro_dir): os.mkdir(prepro_dir) rel2id = json.load(open(os.path.join(data_dir, 'rel2id.json'), "r")) id2rel = {v: k for k, v in rel2id.items()} word2id = json...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/test.py
code/test.py
import sklearn.metrics import torch from config import * from data import DGLREDataset, DGLREDataloader, BERTDGLREDataset from models.GAIN import GAIN_GloVe, GAIN_BERT from utils import get_cuda, logging, print_params # for ablation # from models.GCNRE_nomention import GAIN_GloVe, GAIN_BERT def test(model, dataloa...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/data.py
code/data.py
import json import math import os import pickle import random from collections import defaultdict import dgl import numpy as np import torch from torch.utils.data import IterableDataset, DataLoader from transformers import * from models.GAIN import Bert from utils import get_cuda IGNORE_INDEX = -100 class DGLREDat...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/models/GAIN.py
code/models/GAIN.py
import dgl import dgl.nn.pytorch as dglnn import numpy as np import torch import torch.nn as nn from transformers import * from utils import get_cuda class GAIN_GloVe(nn.Module): def __init__(self, config): super(GAIN_GloVe, self).__init__() self.config = config word_emb_size = config.wo...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
DreamInvoker/GAIN
https://github.com/DreamInvoker/GAIN/blob/178344cf00789c7ba05cfe4dca90df4b17c2caa9/code/models/GAIN_nomention.py
code/models/GAIN_nomention.py
import dgl import dgl.nn.pytorch as dglnn import torch import torch.nn as nn from transformers import * from utils import get_cuda # for no mention module ablation study class GAIN_GloVe(nn.Module): def __init__(self, config): super(GAIN_GloVe, self).__init__() self.config = config word...
python
MIT
178344cf00789c7ba05cfe4dca90df4b17c2caa9
2026-01-05T07:13:40.516065Z
false
milsto/robust-kalman
https://github.com/milsto/robust-kalman/blob/0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0/robust_kalman/utils.py
robust_kalman/utils.py
""" Utilities for robust Kalman implementation and testing. """ import numpy as np class HuberScore: """Robust Huber score function.""" def __init__(self, delta=1.5): self._delta = delta def evaluate(self, z): if abs(z) >= self._delta: return self._delta * abs(z) - pow(self._d...
python
MIT
0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0
2026-01-05T07:13:41.231759Z
false
milsto/robust-kalman
https://github.com/milsto/robust-kalman/blob/0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0/robust_kalman/__init__.py
robust_kalman/__init__.py
from .robust_kalman import RobustKalman from . import utils
python
MIT
0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0
2026-01-05T07:13:41.231759Z
false
milsto/robust-kalman
https://github.com/milsto/robust-kalman/blob/0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0/robust_kalman/robust_kalman.py
robust_kalman/robust_kalman.py
""" Robust Kalman filter implementation. Author: Milos Stojanovic (github: milsto) """ import numpy as np from scipy.optimize import minimize from .utils import HuberScore class RobustKalman(): """Robust Kalman filter for estimation immune to outliers. The implementation is based on rewriting classical lin...
python
MIT
0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0
2026-01-05T07:13:41.231759Z
false
milsto/robust-kalman
https://github.com/milsto/robust-kalman/blob/0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0/examples/example_advanced.py
examples/example_advanced.py
""" Script to evaluate the robust and adaptive Kalman estimator. Primarily used for to make conclusions and plots for the paper written for Stochastic System Theory (MSc) course at University of Belgrade, School of Electrical Engineering. Author: Milos Stojanovic (github: milsto) """ import numpy as np import matplot...
python
MIT
0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0
2026-01-05T07:13:41.231759Z
false
milsto/robust-kalman
https://github.com/milsto/robust-kalman/blob/0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0/examples/example_simple.py
examples/example_simple.py
""" Simple but fully functional example for usage of the RobustKalman implementation. The system model is defined, system evaluation and estimation loop is implemented and results are plotted. Author: Milos Stojanovic (github: milsto) """ import numpy as np import matplotlib.pyplot as plt import sys sys.path.insert(...
python
MIT
0b241f7c5648efa5b8cba8d71623a0ff0b6ae3a0
2026-01-05T07:13:41.231759Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/train.py
tools/train.py
""" Main Training Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os import torch SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/test_time.py
tools/test_time.py
""" Main Testing Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default_argument_pars...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/test_CDSegNet_ScanNet200.py
tools/test_CDSegNet_ScanNet200.py
""" Main Testing Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default_argument_pars...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/train_CDSegNet_nuScenes.py
tools/train_CDSegNet_nuScenes.py
""" Main Training Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os import torch SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/train_CDSegNet_ScanNet.py
tools/train_CDSegNet_ScanNet.py
""" Main Training Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os import torch SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/train_CDSegNet_ScanNet200.py
tools/train_CDSegNet_ScanNet200.py
""" Main Training Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os import torch SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/test_CDSegNet_ScanNet.py
tools/test_CDSegNet_ScanNet.py
""" Main Testing Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default_argument_pars...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/test_CDSegNet_nuScenes.py
tools/test_CDSegNet_nuScenes.py
""" Main Testing Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default_argument_pars...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/tools/test.py
tools/test.py
""" Main Testing Script Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) from pointcept.engines.defaults import ( default_argument_pars...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/__init__.py
pointcept/__init__.py
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/defaults.py
pointcept/datasets/defaults.py
""" Default Datasets Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob import numpy as np import torch from copy import deepcopy from torch.utils.data import Dataset from collections.abc import Sequence from pointcept.utils.logger import get_...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/arkitscenes.py
pointcept/datasets/arkitscenes.py
""" ArkitScenes Dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob import numpy as np import torch from copy import deepcopy from torch.utils.data import Dataset from pointcept.utils.logger import get_root_logger from .builder import D...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/modelnet.py
pointcept/datasets/modelnet.py
""" ModelNet40 Dataset get sampled point clouds of ModelNet40 (XYZ and normal from mesh, 10k points per shape) at "https://shapenet.cs.stanford.edu/media/modelnet40_normal_resampled.zip" Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import numpy as n...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/nuscenes.py
pointcept/datasets/nuscenes.py
""" nuScenes Dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com), Zheng Zhang Please cite our work if the code is helpful to you. """ import os import numpy as np from collections.abc import Sequence import pickle from .builder import DATASETS from .defaults import DefaultDataset @DATASETS.register_module() cla...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/scannet.py
pointcept/datasets/scannet.py
""" ScanNet20 / ScanNet200 / ScanNet Data Efficient Dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob import numpy as np import torch from copy import deepcopy from torch.utils.data import Dataset from collections.abc import Sequence ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/transform.py
pointcept/datasets/transform.py
""" 3D Point Cloud Augmentation Inspirited by chrischoy/SpatioTemporalSegmentation Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import random import numbers import scipy import scipy.ndimage import scipy.interpolate import scipy.stats import numpy as np impor...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
true
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/structure3d.py
pointcept/datasets/structure3d.py
""" Structured3D Datasets Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob from collections.abc import Sequence from .defaults import DefaultDataset from .builder import DATASETS @DATASETS.register_module() class Structured3DDataset(Defaul...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/semantic_kitti.py
pointcept/datasets/semantic_kitti.py
""" Semantic KITTI dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import numpy as np from .builder import DATASETS from .defaults import DefaultDataset @DATASETS.register_module() class SemanticKITTIDataset(DefaultDataset): def __init__(...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/utils.py
pointcept/datasets/utils.py
""" Utils for Datasets Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import random from collections.abc import Mapping, Sequence import numpy as np import torch from torch.utils.data.dataloader import default_collate def collate_fn(batch): """ collate...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/waymo.py
pointcept/datasets/waymo.py
""" Waymo dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import numpy as np import glob from .builder import DATASETS from .defaults import DefaultDataset @DATASETS.register_module() class WaymoDataset(DefaultDataset): def __init__( ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/__init__.py
pointcept/datasets/__init__.py
from .defaults import DefaultDataset, ConcatDataset from .builder import build_dataset from .utils import point_collate_fn, collate_fn # indoor scene from .s3dis import S3DISDataset from .scannet import ScanNetDataset, ScanNet200Dataset from .scannet_pair import ScanNetPairDataset from .arkitscenes import ArkitScenesD...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/dataloader.py
pointcept/datasets/dataloader.py
from functools import partial import weakref import torch import torch.utils.data import pointcept.utils.comm as comm from pointcept.datasets.utils import point_collate_fn from pointcept.datasets import ConcatDataset from pointcept.utils.env import set_seed class MultiDatasetDummySampler: def __init__(self): ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/shapenet_part.py
pointcept/datasets/shapenet_part.py
""" ShapeNet Part Dataset (Unmaintained) get processed shapenet part dataset at "https://shapenet.cs.stanford.edu/media/shapenetcore_partanno_segmentation_benchmark_v0_normal.zip" Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import json import torch...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/s3dis.py
pointcept/datasets/s3dis.py
""" S3DIS Dataset Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob import numpy as np import torch from copy import deepcopy from torch.utils.data import Dataset from collections.abc import Sequence from pointcept.utils.logger import get_roo...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/scannet_pair.py
pointcept/datasets/scannet_pair.py
""" ScanNet Pair Dataset (Frame-level contrastive view) Refer PointContrast Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import glob import numpy as np import torch from copy import deepcopy from torch.utils.data import Dataset from pointcept.utils...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/builder.py
pointcept/datasets/builder.py
""" Dataset Builder Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from pointcept.utils.registry import Registry DATASETS = Registry("datasets") def build_dataset(cfg): """Build datasets.""" return DATASETS.build(cfg)
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/s3dis/preprocess_s3dis_voxelized.py
pointcept/datasets/preprocessing/s3dis/preprocess_s3dis_voxelized.py
""" Preprocessing Script for S3DIS Parsing normal vectors has a large consumption of memory. Please reduce max_workers if memory is limited. Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import argparse import glob import torch import numpy as np impo...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/s3dis/preprocess_s3dis.py
pointcept/datasets/preprocessing/s3dis/preprocess_s3dis.py
""" Preprocessing Script for S3DIS Parsing normal vectors has a large consumption of memory. Please reduce max_workers if memory is limited. Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os import argparse import glob import torch import numpy as np impo...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/structured3d/preprocess_structured3d.py
pointcept/datasets/preprocessing/structured3d/preprocess_structured3d.py
""" Preprocessing Script for Structured3D Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import argparse import io import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(SCRIPT_DIR)) import PIL from PIL i...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/preprocess_scannet.py
pointcept/datasets/preprocessing/scannet/preprocess_scannet.py
""" Preprocessing Script for ScanNet 20/200 Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import warnings import torch warnings.filterwarnings("ignore", category=DeprecationWarning) import os import argparse import glob import json import plyfile import nump...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/meta_data/scannet200_splits.py
pointcept/datasets/preprocessing/scannet/meta_data/scannet200_splits.py
# This file contains the HEAD - COMMON - TAIL split category ids for ScanNet 200 HEAD_CATS_SCANNET_200 = [ "tv stand", "curtain", "blinds", "shower curtain", "bookshelf", "tv", "kitchen cabinet", "pillow", "lamp", "dresser", "monitor", "object", "ceiling", "board...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/meta_data/scannet200_constants.py
pointcept/datasets/preprocessing/scannet/meta_data/scannet200_constants.py
# ScanNet Benchmark constants VALID_CLASS_IDS_20 = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39, ) CLASS_LABELS_20 = ( "wall", "floor", "cabinet", "bed", "chair", "sofa", "table", ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/compute_full_overlapping.py
pointcept/datasets/preprocessing/scannet/scannet_pair/compute_full_overlapping.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import copy import torch import numpy as np import math import glob, os import argparse import open3d as o3d def make_open3d_point_cloud(xyz...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/SensorData.py
pointcept/datasets/preprocessing/scannet/scannet_pair/SensorData.py
import os, struct import numpy as np import zlib import imageio import cv2 COMPRESSION_TYPE_COLOR = {-1: "unknown", 0: "raw", 1: "png", 2: "jpeg"} COMPRESSION_TYPE_DEPTH = { -1: "unknown", 0: "raw_ushort", 1: "zlib_ushort", 2: "occi_ushort", } class RGBDFrame: def load(self, file_handle): ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/reader.py
pointcept/datasets/preprocessing/scannet/scannet_pair/reader.py
import argparse import os, sys from SensorData import SensorData def reader( filename, output_path, frame_skip, export_color_images=False, export_depth_images=False, export_poses=False, export_intrinsics=False, ): if not os.path.exists(output_path): os.makedirs(output_path) ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/generage_list.py
pointcept/datasets/preprocessing/scannet/scannet_pair/generage_list.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import glob, os, sys from SensorData import SensorData # params parser = argparse.ArgumentParser() # data paths parser.add_...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/plyfile.py
pointcept/datasets/preprocessing/scannet/scannet_pair/plyfile.py
# Copyright 2014 Darsh Ranjan # # This file is part of python-plyfile. # # python-plyfile is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/point_cloud_extractor.py
pointcept/datasets/preprocessing/scannet/scannet_pair/point_cloud_extractor.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import glob, os import numpy as np import cv2 import torch def extractor(input_path, output_path): if not os.path.exists(output_path): ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/scannet/scannet_pair/preprocess.py
pointcept/datasets/preprocessing/scannet/scannet_pair/preprocess.py
import os import argparse import glob import multiprocessing as mp from concurrent.futures import ProcessPoolExecutor from itertools import repeat from reader import reader from point_cloud_extractor import extractor from compute_full_overlapping import compute_full_overlapping frame_skip = 25 def parse_sens(sens_d...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/arkitscenes/preprocess_arkitscenes_mesh.py
pointcept/datasets/preprocessing/arkitscenes/preprocess_arkitscenes_mesh.py
""" Preprocessing ArkitScenes """ import os import argparse import glob import plyfile import numpy as np import pandas as pd import multiprocessing as mp from concurrent.futures import ProcessPoolExecutor from itertools import repeat import torch def read_plymesh(filepath): """Read ply file and return it as nu...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/nuscenes/preprocess_nuscenes_info.py
pointcept/datasets/preprocessing/nuscenes/preprocess_nuscenes_info.py
""" Preprocessing Script for nuScenes Informantion modified from OpenPCDet (https://github.com/open-mmlab/OpenPCDet) Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import os from pathlib import Path import numpy as np import argparse import tqdm import pickle fr...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/datasets/preprocessing/waymo/preprocess_waymo.py
pointcept/datasets/preprocessing/waymo/preprocess_waymo.py
""" Preprocessing Script for ScanNet 20/200 Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" os.environ["CUDA_VISIBLE_DEVICES"] = "...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/default.py
pointcept/models/default.py
import torch.nn as nn import torch import numpy as np import math from scipy import special from pointcept.utils.comm import calc_t_emb from pointcept.models.losses import build_criteria from pointcept.models.utils.structure import Point from .builder import MODELS, build_model ### ---------------------------- ① ----...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
true
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/modules.py
pointcept/models/modules.py
import sys import torch.nn as nn import spconv.pytorch as spconv from collections import OrderedDict from pointcept.models.utils.structure import Point class PointModule(nn.Module): r"""PointModule placeholder, all module subclass from this will take Point in PointSequential. """ def __init__(self, *...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/__init__.py
pointcept/models/__init__.py
from .builder import build_model from .default import DefaultSegmentor, DefaultClassifier # Backbones from .sparse_unet import * from .point_transformer import * from .point_transformer_v2 import * from .point_transformer_v3 import * from .stratified_transformer import * from .spvcnn import * from .octformer import * ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/builder.py
pointcept/models/builder.py
""" Model Builder Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from pointcept.utils.registry import Registry MODELS = Registry("models") MODULES = Registry("modules") def build_model(cfg): """Build models.""" return MODELS.build(cfg)
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/oacnns/__init__.py
pointcept/models/oacnns/__init__.py
from .oacnns_v1m1_base import OACNNs
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/oacnns/oacnns_v1m1_base.py
pointcept/models/oacnns/oacnns_v1m1_base.py
from functools import partial import torch import torch.nn as nn from einops import rearrange import spconv.pytorch as spconv from timm.models.layers import trunc_normal_ from ..builder import MODELS from ..utils import offset2batch from torch_geometric.nn.pool import voxel_grid from torch_geometric.utils import scatte...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/losses/misc.py
pointcept/models/losses/misc.py
""" Misc Losses Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import torch import torch.nn as nn import torch.nn.functional as F from .builder import LOSSES def ignore_label(scores, labels, ignore=None): """Flattens predictions in the batch (binary case) ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/losses/__init__.py
pointcept/models/losses/__init__.py
from .builder import build_criteria from .misc import CrossEntropyLoss, SmoothCELoss, DiceLoss, FocalLoss, BinaryFocalLoss from .lovasz import LovaszLoss
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/losses/builder.py
pointcept/models/losses/builder.py
""" Criteria Builder Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import torch import torch.nn as nn import torch.nn.functional as F from pointcept.utils.registry import Registry LOSSES = Registry("losses") class Criteria(object): def __init__(self, cfg=N...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/losses/lovasz.py
pointcept/models/losses/lovasz.py
""" Lovasz Loss refer https://arxiv.org/abs/1705.08790 Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from typing import Optional from itertools import filterfalse import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from .builde...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/sparse_unet/mink_unet.py
pointcept/models/sparse_unet/mink_unet.py
""" SparseUNet Driven by MinkowskiEngine Modified from chrischoy/SpatioTemporalSegmentation Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import torch import torch.nn as nn try: import MinkowskiEngine as ME except ImportError: ME = None from pointcep...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/sparse_unet/spconv_unet_v1m3_pdnorm.py
pointcept/models/sparse_unet/spconv_unet_v1m3_pdnorm.py
""" SparseUNet V1M3 Enable Prompt-Driven Normalization for Point Prompt Training Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn import spconv.pytorch as spcon...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/sparse_unet/__init__.py
pointcept/models/sparse_unet/__init__.py
from .mink_unet import * from .spconv_unet_v1m1_base import * from .spconv_unet_v1m2_bn_momentum import * from .spconv_unet_v1m3_pdnorm import *
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/sparse_unet/spconv_unet_v1m1_base.py
pointcept/models/sparse_unet/spconv_unet_v1m1_base.py
""" SparseUNet Driven by SpConv (recommend) Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn import spconv.pytorch as spconv from torch_geometric.utils import sc...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/sparse_unet/spconv_unet_v1m2_bn_momentum.py
pointcept/models/sparse_unet/spconv_unet_v1m2_bn_momentum.py
""" SparseUNet Driven by SpConv (recommend) Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn try: import spconv.pytorch as spconv except ImportError: imp...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/point_prompt_training/prompt_driven_normalization.py
pointcept/models/point_prompt_training/prompt_driven_normalization.py
import torch.nn as nn from pointcept.models.modules import PointModule, PointSequential from pointcept.models.builder import MODULES @MODULES.register_module() class PDNorm(PointModule): def __init__( self, num_features, norm_layer, context_channels=256, conditions=("ScanN...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/point_prompt_training/point_prompt_training_v1m2_decoupled.py
pointcept/models/point_prompt_training/point_prompt_training_v1m2_decoupled.py
""" Point Prompt Training with decoupled segmentation head Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn from pointcept.models.utils.structure import Point fro...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/point_prompt_training/point_prompt_training_v1m1_language_guided.py
pointcept/models/point_prompt_training/point_prompt_training_v1m1_language_guided.py
""" Point Prompt Training Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from functools import partial from collections import OrderedDict import numpy as np import math import torch import torch.nn as nn from pointcept.utils.comm import calc_t_emb from pointc...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/point_prompt_training/__init__.py
pointcept/models/point_prompt_training/__init__.py
from .point_prompt_training_v1m1_language_guided import * from .point_prompt_training_v1m2_decoupled import * from .prompt_driven_normalization import PDNorm
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/structure.py
pointcept/models/utils/structure.py
import torch import spconv.pytorch as spconv try: import ocnn except ImportError: ocnn = None from addict import Dict from pointcept.models.utils.serialization import encode, decode from pointcept.models.utils import offset2batch, batch2offset class Point(Dict): """ Point Structure of Pointcept ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/checkpoint.py
pointcept/models/utils/checkpoint.py
""" Checkpoint Utils for Models Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import torch class CheckpointFunction(torch.autograd.Function): @staticmethod def forward(ctx, run_function, length, *args): ctx.run_function = run_function ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/misc.py
pointcept/models/utils/misc.py
""" General Utils for Models Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ import torch @torch.inference_mode() def offset2bincount(offset): return torch.diff( offset, prepend=torch.tensor([0], device=offset.device, dtype=torch.long) ) @torc...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/__init__.py
pointcept/models/utils/__init__.py
from .misc import offset2batch, offset2bincount, batch2offset, off_diagonal from .checkpoint import checkpoint from .serialization import encode, decode from .structure import Point
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/serialization/default.py
pointcept/models/utils/serialization/default.py
import torch from .z_order import xyz2key as z_order_encode_ from .z_order import key2xyz as z_order_decode_ from .hilbert import encode as hilbert_encode_ from .hilbert import decode as hilbert_decode_ @torch.inference_mode() def encode(grid_coord, batch=None, depth=16, order="z"): assert order in {"z", "z-trans...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/serialization/hilbert.py
pointcept/models/utils/serialization/hilbert.py
""" Hilbert Order Modified from https://github.com/PrincetonLIPS/numpy-hilbert-curve Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com), Kaixin Xu Please cite our work if the code is helpful to you. """ import torch def right_shift(binary, k=1, axis=-1): """Right shift an array of binary values. Parameters: ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/serialization/z_order.py
pointcept/models/utils/serialization/z_order.py
# -------------------------------------------------------- # Octree-based Sparse Convolutional Neural Networks # Copyright (c) 2022 Peng-Shuai Wang <wangps@hotmail.com> # Licensed under The MIT License [see LICENSE for details] # Written by Peng-Shuai Wang # -------------------------------------------------------- imp...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/utils/serialization/__init__.py
pointcept/models/utils/serialization/__init__.py
from .default import ( encode, decode, z_order_encode, z_order_decode, hilbert_encode, hilbert_decode, )
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/octformer/octformer_v1m1_base.py
pointcept/models/octformer/octformer_v1m1_base.py
""" Octree Transformer Modified from https://github.com/octree-nn/octformer Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) Please cite our work if the code is helpful to you. """ from typing import Optional, List, Dict import torch import torch.nn as nn from torch.utils.checkpoint import checkpoint try: import ...
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false
QWTforGithub/CDSegNet
https://github.com/QWTforGithub/CDSegNet/blob/87b603dbd011c0f57fb498d70680e32d4f8cf2f0/pointcept/models/octformer/__init__.py
pointcept/models/octformer/__init__.py
from .octformer_v1m1_base import OctFormer
python
MIT
87b603dbd011c0f57fb498d70680e32d4f8cf2f0
2026-01-05T07:13:40.759144Z
false