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 |
|---|---|---|---|---|---|---|---|---|
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/leaderboard/utils/statistics_manager.py | leaderboard/leaderboard/utils/statistics_manager.py | #!/usr/bin/env python
# Copyright (c) 2018-2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module contains a statistics manager for the CARLA AD leaderboard
"""
from __future__ import print_function
from dictor im... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/leaderboard/utils/route_indexer.py | leaderboard/leaderboard/utils/route_indexer.py | from collections import OrderedDict
from dictor import dictor
import copy
from srunner.scenarioconfigs.route_scenario_configuration import RouteScenarioConfiguration
from leaderboard.utils.route_parser import RouteParser
from leaderboard.utils.checkpoint_tools import fetch_dict, create_default_json_msg, save_dict
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/leaderboard/utils/route_parser.py | leaderboard/leaderboard/utils/route_parser.py | #!/usr/bin/env python
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Module used to parse all the route and scenario configuration parameters.
"""
from collections import OrderedDict
import json
import math
import xml.etree.ElementTree as ET
i... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/controller.py | leaderboard/team_code/controller.py | import numpy as np
from collections import deque
class PIDController(object):
def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):
self._K_P = K_P
self._K_I = K_I
self._K_D = K_D
self._window = deque([0 for _ in range(n)], maxlen=n)
self._max = 0.0
self._min = 0.0
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/render.py | leaderboard/team_code/render.py | import numpy as np
import cv2
import math
reweight_array = np.array([1.0, 3.5, 3.5, 2.0, 3.5, 2.0, 8.0])
def add_rect(img, loc, ori, box, value, pixels_per_meter, max_distance, color):
img_size = max_distance * pixels_per_meter * 2
vet_ori = np.array([-ori[1], ori[0]])
hor_offset = box[0] * ori
vet_o... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/tracker.py | leaderboard/team_code/tracker.py | import numpy as np
import math
from team_code.render import find_peak_box
reweight_array = np.array([1.0, 3.5, 3.5, 2.0, 3.5, 2.0, 8.0])
def get_yaw_angle(forward_vector):
forward_vector = forward_vector / np.linalg.norm(forward_vector)
yaw = math.acos(forward_vector[0])
if forward_vector[1] < 0:
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/pid_controller.py | leaderboard/team_code/pid_controller.py | from collections import deque
import numpy as np
class PIDController(object):
def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):
self._K_P = K_P
self._K_I = K_I
self._K_D = K_D
self._window = deque([0 for _ in range(n)], maxlen=n)
self._max = 0.0
self._min = 0.0... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/interfuser_config.py | leaderboard/team_code/interfuser_config.py | import os
class GlobalConfig:
"""base architecture configurations"""
# Controller
turn_KP = 1.25
turn_KI = 0.75
turn_KD = 0.3
turn_n = 40 # buffer size
speed_KP = 5.0
speed_KI = 0.5
speed_KD = 1.0
speed_n = 40 # buffer size
max_throttle = 0.75 # upper limit on throttl... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/auto_pilot.py | leaderboard/team_code/auto_pilot.py | import os
import time
import datetime
import pathlib
import json
import random
import shapely
import math
from collections import deque
from itertools import chain
import numpy as np
import cv2
import carla
from carla_birdeye_view import BirdViewProducer, BirdViewCropType, PixelDimensions
from PIL import Image
from t... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/interfuser_controller.py | leaderboard/team_code/interfuser_controller.py | import numpy as np
from collections import deque
from team_code.render import render, render_self_car, find_peak_box
class PIDController(object):
def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):
self._K_P = K_P
self._K_I = K_I
self._K_D = K_D
self._window = deque([0 for _ in ra... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/base_agent.py | leaderboard/team_code/base_agent.py | import time
import os
import datetime
import pathlib
import json
import yaml
from collections import deque
import cv2
import carla
from leaderboard.autoagents import autonomous_agent
from team_code.planner import RoutePlanner
import numpy as np
from PIL import Image, ImageDraw
SAVE_PATH = os.environ.get("SAVE_PATH... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/map_agent.py | leaderboard/team_code/map_agent.py | import numpy as np
from PIL import Image, ImageDraw
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
from team_code.base_agent import BaseAgent
from team_code.planner import RoutePlanner
class MapAgent(BaseAgent):
def sensors(self):
result = super().sensors()
result.appe... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/utils.py | leaderboard/team_code/utils.py | import os
import re
import numpy as np
def lidar_to_histogram_features(lidar, crop=256):
"""
Convert LiDAR point cloud into 2-bin histogram over 256x256 grid
"""
def splat_points(point_cloud):
# 256 x 256 grid
pixels_per_meter = 8
hist_max_per_pixel = 5
x_meters_max = 1... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/interfuser_agent.py | leaderboard/team_code/interfuser_agent.py | import os
import json
import datetime
import pathlib
import time
import imp
import cv2
import carla
from collections import deque
import torch
import carla
import numpy as np
from PIL import Image
from easydict import EasyDict
from torchvision import transforms
from leaderboard.autoagents import autonomous_agent
from... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/leaderboard/team_code/planner.py | leaderboard/team_code/planner.py | import os
from collections import deque
import numpy as np
DEBUG = int(os.environ.get("HAS_DISPLAY", 0))
class Plotter(object):
def __init__(self, size):
self.size = size
self.clear()
self.title = str(self.size)
def clear(self):
from PIL import Image, ImageDraw
sel... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/sample_junctions.py | tools/sample_junctions.py | import os
import sys
import json
import time
import argparse
import multiprocessing
import lxml.etree as ET
import numpy as np
import matplotlib.pyplot as plt
import carla
from agents.navigation.global_route_planner import GlobalRoutePlanner
from agents.navigation.global_route_planner_dao import GlobalRoutePlannerDAO... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/generate_scenarios.py | tools/generate_scenarios.py | import os
import sys
import numpy as np
import json
import argparse
import xml.etree.ElementTree as ET
import cv2
import copy
import glob
import ast
from pathlib import Path
def main(args):
if args.towns == "all":
towns = ["Town01", "Town02", "Town03", "Town04", "Town05", "Town06"]
else:
towns... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/interpolate_route.py | tools/interpolate_route.py | import os
import sys
import json
import argparse
import xml.etree.ElementTree as ET
import numpy as np
import matplotlib.pyplot as plt
import carla
from agents.navigation.global_route_planner import GlobalRoutePlanner
from agents.navigation.global_route_planner_dao import GlobalRoutePlannerDAO
# navigational command... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/generate_intersection_routes.py | tools/generate_intersection_routes.py | import glob
import os
import sys
import lxml.etree as ET
import argparse
import random
import time
import carla
SAMPLING_DISTANCE = [100]
def add_intersection(transform, root, route_id):
"""
Sample (start wp, end wp) pair along the canonical axes in a 100x100 grid
Args:
transform: carla transfor... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_rm_haze_data.py | tools/data/batch_rm_haze_data.py | import os
import json
import numpy as np
from tqdm import tqdm
from multiprocessing import Pool
dt = {}
dt["topdown"] = "%04d.jpg"
dt["seg_right"] = "%04d.jpg"
dt["seg_left"] = "%04d.jpg"
dt["seg_front"] = "%04d.jpg"
dt["rgb_right"] = "%04d.jpg"
dt["rgb_left"] = "%04d.jpg"
dt["rgb_front"] = "%04d.jpg"
dt["rgb_rear"] =... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_stat_blocked_data.py | tools/data/batch_stat_blocked_data.py | import os
import json
import numpy as np
from tqdm import tqdm
from multiprocessing import Pool
routes = []
for i in range(14):
subs = os.listdir(os.path.join("dataset", "weather-%d" % i, "data"))
for sub in subs:
if not os.path.isdir(os.path.join("dataset", "weather-%d" % i, "data", sub)):
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_preload.py | tools/data/batch_preload.py | import os
import json
import numpy as np
from tqdm import tqdm
from multiprocessing import Pool
routes = []
for i in range(14):
subs = os.listdir(os.path.join("dataset", "weather-%d" % i, "data"))
for sub in subs:
if not os.path.isdir(os.path.join("dataset", "weather-%d" % i, "data", sub)):
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_merge_data.py | tools/data/batch_merge_data.py | import os
import time
import sys
import json
from tqdm import tqdm
from PIL import Image
from multiprocessing import Pool
import numpy as np
def process(route):
try:
frames = len(os.listdir(os.path.join(route, "measurements")))
flag = 2
if not os.path.exists(os.path.join(route, "rgb_full"... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_mv_data.py | tools/data/batch_mv_data.py | import sys
import os
import json
import random
from tqdm import tqdm
src_dir = sys.argv[1]
target_dir = sys.argv[2]
# Move data(data & result) to dataset dir
for w in range(14):
subs = os.listdir("%s/weather-%d/data" % (src_dir, w))
for sub in subs:
route_dir = os.path.join("%s/weather-%d" % (src_dir,... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_recollect_blocked_data.py | tools/data/batch_recollect_blocked_data.py | import os
import json
import numpy as np
from tqdm import tqdm
from multiprocessing import Pool
dt = {}
dt["topdown"] = "%04d.jpg"
dt["seg_right"] = "%04d.jpg"
dt["seg_left"] = "%04d.jpg"
dt["seg_front"] = "%04d.jpg"
dt["rgb_right"] = "%04d.jpg"
dt["rgb_left"] = "%04d.jpg"
dt["rgb_front"] = "%04d.jpg"
dt["rgb_rear"] =... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/tools/data/batch_stat_data.py | tools/data/batch_stat_data.py | import os
from collections import defaultdict
import json
import numpy as np
from tqdm import tqdm
from multiprocessing import Pool
routes = []
SAMPLE_RATE = 0.02
STAT_DISCRETE_KEYS = [
"command",
"weather_id",
"should_brake",
"should_slow",
"is_junction",
"is_vehicle_present",
"is_bike_pre... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/TCP/model.py | TCP/model.py | from collections import deque
import numpy as np
import torch
from torch import nn
import sys,os
from TCP.resnet import *
from TCP.resnet import resnet10,resnet6
class PIDController(object):
def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):
self._K_P = K_P
self._K_I = K_I
self._K_D = K... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/TCP/resnet.py | TCP/resnet.py | import torch
from torch import Tensor
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/train.py | interfuser/train.py | #!/usr/bin/env python3
""" ImageNet Training Script
This is intended to be a lean and easily modifiable ImageNet training script that reproduces ImageNet
training results with some of the latest networks and training techniques. It favours canonical PyTorch
and standard Python style over trying to be able to 'do it al... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/render.py | interfuser/render.py | import numpy as np
import cv2
import math
reweight_array = np.array([1.0, 3.5, 3.5, 2.0, 3.5, 2.0, 8.0])
def add_rect(img, loc, ori, box, value, pixels_per_meter, max_distance, color):
img_size = max_distance * pixels_per_meter * 2
vet_ori = np.array([-ori[1], ori[0]])
hor_offset = box[0] * ori
vet_o... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/setup.py | interfuser/setup.py | """ Setup
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
exec(open("timm/version.py"... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/hubconf.py | interfuser/hubconf.py | dependencies = ["torch"]
from timm.models import registry
globals().update(registry._model_entrypoints)
| python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/plankd.py | interfuser/plankd.py | import math
import copy
import torch
from torch import nn, Tensor
import torch.nn.functional as F
import torch.nn as nn
from functools import partial
import numpy as np
import logging
from torchvision import transforms
from timm.models.resnet2 import resnet6e, resnet10_2, resnet6d
from torch.autograd import Variable
im... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/tests/test_optim.py | interfuser/tests/test_optim.py | """ Optimzier Tests
These tests were adapted from PyTorch' optimizer tests.
"""
import math
import pytest
import functools
from copy import deepcopy
import torch
from torch.testing._internal.common_utils import TestCase
from torch.autograd import Variable
from timm.scheduler import PlateauLRScheduler
from timm.opti... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/tests/test_models.py | interfuser/tests/test_models.py | import pytest
import torch
import platform
import os
import fnmatch
import timm
from timm import (
list_models,
create_model,
set_scriptable,
has_model_default_key,
is_model_default_key,
get_model_default_value,
)
if hasattr(torch._C, "_jit_set_profiling_executor"):
# legacy executor is to... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/tests/__init__.py | interfuser/tests/__init__.py | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false | |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/tests/test_layers.py | interfuser/tests/test_layers.py | import pytest
import torch
import torch.nn as nn
import platform
import os
from timm.models.layers import create_act_layer, get_act_layer, set_layer_config
class MLP(nn.Module):
def __init__(self, act_layer="relu", inplace=True):
super(MLP, self).__init__()
self.fc1 = nn.Linear(1000, 100)
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/version.py | interfuser/timm/version.py | __version__ = "0.4.13"
| python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/__init__.py | interfuser/timm/__init__.py | from .version import __version__
from .models import (
create_model,
list_models,
is_model,
list_modules,
model_entrypoint,
is_scriptable,
is_exportable,
set_scriptable,
set_exportable,
has_model_default_key,
is_model_default_key,
get_model_default_value,
is_model_pre... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/loss/asymmetric_loss.py | interfuser/timm/loss/asymmetric_loss.py | import torch
import torch.nn as nn
class AsymmetricLossMultiLabel(nn.Module):
def __init__(
self,
gamma_neg=4,
gamma_pos=1,
clip=0.05,
eps=1e-8,
disable_torch_grad_focal_loss=False,
):
super(AsymmetricLossMultiLabel, self).__init__()
self.gamma_... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/loss/jsd.py | interfuser/timm/loss/jsd.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .cross_entropy import LabelSmoothingCrossEntropy
class JsdCrossEntropy(nn.Module):
"""Jensen-Shannon Divergence + Cross-Entropy Loss
Based on impl here: https://github.com/google-research/augmix/blob/master/imagenet.py
From paper: '... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/loss/cross_entropy.py | interfuser/timm/loss/cross_entropy.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class LabelSmoothingCrossEntropy(nn.Module):
"""
NLL loss with label smoothing.
"""
def __init__(self, smoothing=0.1):
"""
Constructor for the LabelSmoothing module.
:param smoothing: label smoothing factor
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/loss/__init__.py | interfuser/timm/loss/__init__.py | from .cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from .jsd import JsdCrossEntropy
from .asymmetric_loss import AsymmetricLossMultiLabel, AsymmetricLossSingleLabel
| python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/efficientnet.py | interfuser/timm/models/efficientnet.py | """ The EfficientNet Family in PyTorch
An implementation of EfficienNet that covers variety of related models with efficient architectures:
* EfficientNet-V2
- `EfficientNetV2: Smaller Models and Faster Training` - https://arxiv.org/abs/2104.00298
* EfficientNet (B0-B8, L2 + Tensorflow pretrained AutoAug/RandAug/A... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/resnetv2.py | interfuser/timm/models/resnetv2.py | """Pre-Activation ResNet v2 with GroupNorm and Weight Standardization.
A PyTorch implementation of ResNetV2 adapted from the Google Big-Transfoer (BiT) source code
at https://github.com/google-research/big_transfer to match timm interfaces. The BiT weights have
been included here as pretrained models from their origin... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/vovnet.py | interfuser/timm/models/vovnet.py | """ VoVNet (V1 & V2)
Papers:
* `An Energy and GPU-Computation Efficient Backbone Network` - https://arxiv.org/abs/1904.09730
* `CenterMask : Real-Time Anchor-Free Instance Segmentation` - https://arxiv.org/abs/1911.06667
Looked at https://github.com/youngwanLEE/vovnet-detectron2 &
https://github.com/stigma0617/VoVNe... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/resnest.py | interfuser/timm/models/resnest.py | """ ResNeSt Models
Paper: `ResNeSt: Split-Attention Networks` - https://arxiv.org/abs/2004.08955
Adapted from original PyTorch impl w/ weights at https://github.com/zhanghang1989/ResNeSt by Hang Zhang
Modified for torchscript compat, and consistency with timm by Ross Wightman
"""
import torch
from torch import nn
f... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/hrnet.py | interfuser/timm/models/hrnet.py | """ HRNet
Copied from https://github.com/HRNet/HRNet-Image-Classification
Original header:
Copyright (c) Microsoft
Licensed under the MIT License.
Written by Bin Xiao (Bin.Xiao@microsoft.com)
Modified by Ke Sun (sunk@mail.ustc.edu.cn)
"""
import logging
from typing import List
import torch
import torch.nn as... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/byobnet.py | interfuser/timm/models/byobnet.py | """ Bring-Your-Own-Blocks Network
A flexible network w/ dataclass based config for stacking those NN blocks.
This model is currently used to implement the following networks:
GPU Efficient (ResNets) - gernet_l/m/s (original versions called genet, but this was already used (by SENet author)).
Paper: `Neural Architect... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/tnt.py | interfuser/timm/models/tnt.py | """ Transformer in Transformer (TNT) in PyTorch
A PyTorch implement of TNT as described in
'Transformer in Transformer' - https://arxiv.org/abs/2103.00112
The official mindspore code is released and available at
https://gitee.com/mindspore/mindspore/tree/master/model_zoo/research/cv/TNT
"""
import math
import torch
i... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/rexnet.py | interfuser/timm/models/rexnet.py | """ ReXNet
A PyTorch impl of `ReXNet: Diminishing Representational Bottleneck on Convolutional Neural Network` -
https://arxiv.org/abs/2007.00992
Adapted from original impl at https://github.com/clovaai/rexnet
Copyright (c) 2020-present NAVER Corp. MIT license
Changes for timm, feature extraction, and rounded channe... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/vision_transformer_hybrid.py | interfuser/timm/models/vision_transformer_hybrid.py | """ Hybrid Vision Transformer (ViT) in PyTorch
A PyTorch implement of the Hybrid Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transfor... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/registry.py | interfuser/timm/models/registry.py | """ Model Registry
Hacked together by / Copyright 2020 Ross Wightman
"""
import sys
import re
import fnmatch
from collections import defaultdict
from copy import deepcopy
__all__ = [
"list_models",
"is_model",
"model_entrypoint",
"list_modules",
"is_model_in_modules",
"is_model_default_key",
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/gluon_resnet.py | interfuser/timm/models/gluon_resnet.py | """Pytorch impl of MxNet Gluon ResNet/(SE)ResNeXt variants
This file evolved from https://github.com/pytorch/vision 'resnet.py' with (SE)-ResNeXt additions
and ports of Gluon variations (https://github.com/dmlc/gluon-cv/blob/master/gluoncv/model_zoo/resnet.py)
by Ross Wightman
"""
from timm.data import IMAGENET_DEFAU... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/ghostnet.py | interfuser/timm/models/ghostnet.py | """
An implementation of GhostNet Model as defined in:
GhostNet: More Features from Cheap Operations. https://arxiv.org/abs/1911.11907
The train script of the model is similar to that of MobileNetV3
Original model: https://github.com/huawei-noah/CV-backbones/tree/master/ghostnet_pytorch
"""
import math
from functools i... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/vgg.py | interfuser/timm/models/vgg.py | """VGG
Adapted from https://github.com/pytorch/vision 'vgg.py' (BSD-3-Clause) with a few changes for
timm functionality.
Copyright 2021 Ross Wightman
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Union, List, Dict, Any, cast
from timm.data import IMAGENET_DEFAULT_MEAN, IMA... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/swin_transformer.py | interfuser/timm/models/swin_transformer.py | """ Swin Transformer
A PyTorch impl of : `Swin Transformer: Hierarchical Vision Transformer using Shifted Windows`
- https://arxiv.org/pdf/2103.14030
Code/weights from https://github.com/microsoft/Swin-Transformer, original copyright/license info below
"""
# -------------------------------------------------------... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/inception_v4.py | interfuser/timm/models/inception_v4.py | """ Pytorch Inception-V4 implementation
Sourced from https://github.com/Cadene/tensorflow-model-zoo.torch (MIT License) which is
based upon Google's Tensorflow implementation and pretrained weights (Apache 2.0 License)
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import IMAGENE... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/pnasnet.py | interfuser/timm/models/pnasnet.py | """
pnasnet5large implementation grabbed from Cadene's pretrained models
Additional credit to https://github.com/creafz
https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/pnasnet.py
"""
from collections import OrderedDict
from functools import partial
import torch
import torch... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/gluon_xception.py | interfuser/timm/models/gluon_xception.py | """Pytorch impl of Gluon Xception
This is a port of the Gluon Xception code and weights, itself ported from a PyTorch DeepLab impl.
Gluon model: (https://gluon-cv.mxnet.io/_modules/gluoncv/model_zoo/xception.html)
Original PyTorch DeepLab impl: https://github.com/jfzhang95/pytorch-deeplab-xception
Hacked together by ... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/efficientnet_builder.py | interfuser/timm/models/efficientnet_builder.py | """ EfficientNet, MobileNetV3, etc Builder
Assembles EfficieNet and related network feature blocks from string definitions.
Handles stride, dilation calculations, and selects feature extraction points.
Hacked together by / Copyright 2020 Ross Wightman
"""
import logging
import math
import re
from copy import deepcop... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/vision_transformer.py | interfuser/timm/models/vision_transformer.py | """ Vision Transformer (ViT) in PyTorch
A PyTorch implement of Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers`
- https:... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/nest.py | interfuser/timm/models/nest.py | """ Nested Transformer (NesT) in PyTorch
A PyTorch implement of Aggregating Nested Transformers as described in:
'Aggregating Nested Transformers'
- https://arxiv.org/abs/2105.12723
The official Jax code is released and available at https://github.com/google-research/nested-transformer. The weights
have been con... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/dpn.py | interfuser/timm/models/dpn.py | """ PyTorch implementation of DualPathNetworks
Based on original MXNet implementation https://github.com/cypw/DPNs with
many ideas from another PyTorch implementation https://github.com/oyam/pytorch-DPNs.
This implementation is compatible with the pretrained weights from cypw's MXNet implementation.
Hacked together b... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/hardcorenas.py | interfuser/timm/models/hardcorenas.py | from functools import partial
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from .efficientnet_blocks import SqueezeExcite
from .efficientnet_builder import (
decode_arch_def,
resolve_act_layer,
resolve_bn_args,
round_channels,
)
from .helpers import build_mod... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/selecsls.py | interfuser/timm/models/selecsls.py | """PyTorch SelecSLS Net example for ImageNet Classification
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/legalcode)
Author: Dushyant Mehta (@mehtadushy)
SelecSLS (core) Network Architecture as proposed in "XNect: Real-time Multi-person 3D
Human Pose Estimation with a Single RGB Camera, Mehta et al."... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/dla.py | interfuser/timm/models/dla.py | """ Deep Layer Aggregation and DLA w/ Res2Net
DLA original adapted from Official Pytorch impl at:
DLA Paper: `Deep Layer Aggregation` - https://arxiv.org/abs/1707.06484
Res2Net additions from: https://github.com/gasvn/Res2Net/
Res2Net Paper: `Res2Net: A New Multi-scale Backbone Architecture` - https://arxiv.org/abs/19... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/pit.py | interfuser/timm/models/pit.py | """ Pooling-based Vision Transformer (PiT) in PyTorch
A PyTorch implement of Pooling-based Vision Transformers as described in
'Rethinking Spatial Dimensions of Vision Transformers' - https://arxiv.org/abs/2103.16302
This code was adapted from the original version at https://github.com/naver-ai/pit, original copyrigh... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/resnet.py | interfuser/timm/models/resnet.py | """PyTorch ResNet
This started as a copy of https://github.com/pytorch/vision 'resnet.py' (BSD-3-Clause) with
additional dropout and dynamic global avg/max pool.
ResNeXt, SE-ResNeXt, SENet, and MXNet Gluon stem/downsample variants, tiered stems added by Ross Wightman
Copyright 2020 Ross Wightman
"""
import math
from ... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/inception_v3.py | interfuser/timm/models/inception_v3.py | """ Inception-V3
Originally from torchvision Inception3 model
Licensed BSD-Clause 3 https://github.com/pytorch/vision/blob/master/LICENSE
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import (
IMAGENET_DEFAULT_STD,
IMAGENET_DEFAULT_MEAN,
IMAGENET_INCEPTION_MEAN,
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/levit.py | interfuser/timm/models/levit.py | """ LeViT
Paper: `LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference`
- https://arxiv.org/abs/2104.01136
@article{graham2021levit,
title={LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference},
author={Benjamin Graham and Alaaeldin El-Nouby and Hugo Touvron and Pierre Stoc... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/byoanet.py | interfuser/timm/models/byoanet.py | """ Bring-Your-Own-Attention Network
A flexible network w/ dataclass based config for stacking NN blocks including
self-attention (or similar) layers.
Currently used to implement experimential variants of:
* Bottleneck Transformers
* Lambda ResNets
* HaloNets
Consider all of the models definitions here as expe... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/transfuser.py | interfuser/timm/models/transfuser.py | import math
from collections import deque
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torchvision import models
from .transfuser_config import GlobalConfig
class ImageCNN(nn.Module):
"""
Encoder network for image input list.
Args:
c_dim (int): outp... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/mobilenetv3.py | interfuser/timm/models/mobilenetv3.py | """ MobileNet V3
A PyTorch impl of MobileNet-V3, compatible with TF weights from official impl.
Paper: Searching for MobileNetV3 - https://arxiv.org/abs/1905.02244
Hacked together by / Copyright 2021 Ross Wightman
"""
from functools import partial
from typing import List
import torch
import torch.nn as nn
import to... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/visformer.py | interfuser/timm/models/visformer.py | """ Visformer
Paper: Visformer: The Vision-friendly Transformer - https://arxiv.org/abs/2104.12533
From original at https://github.com/danczs/Visformer
"""
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/helpers.py | interfuser/timm/models/helpers.py | """ Model creation / weight loading / state_dict helpers
Hacked together by / Copyright 2020 Ross Wightman
"""
import logging
import os
import math
from collections import OrderedDict
from copy import deepcopy
from typing import Any, Callable, Optional, Tuple
import torch
import torch.nn as nn
from .features import... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/xception_aligned.py | interfuser/timm/models/xception_aligned.py | """Pytorch impl of Aligned Xception 41, 65, 71
This is a correct, from scratch impl of Aligned Xception (Deeplab) models compatible with TF weights at
https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/model_zoo.md
Hacked together by / Copyright 2020 Ross Wightman
"""
from functools import partia... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/xception.py | interfuser/timm/models/xception.py | """
Ported to pytorch thanks to [tstandley](https://github.com/tstandley/Xception-PyTorch)
@author: tstandley
Adapted by cadene
Creates an Xception Model as defined in:
Francois Chollet
Xception: Deep Learning with Depthwise Separable Convolutions
https://arxiv.org/pdf/1610.02357.pdf
This weights ported from the Ke... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/cait.py | interfuser/timm/models/cait.py | """ Class-Attention in Image Transformers (CaiT)
Paper: 'Going deeper with Image Transformers' - https://arxiv.org/abs/2103.17239
Original code and weights from https://github.com/facebookresearch/deit, copyright below
"""
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
from copy import deepcopy
... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/nasnet.py | interfuser/timm/models/nasnet.py | """ NasNet-A (Large)
nasnetalarge implementation grabbed from Cadene's pretrained models
https://github.com/Cadene/pretrained-models.pytorch
"""
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
from .helpers import build_model_with_cfg
from .layers import ConvBnAct, c... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/nfnet.py | interfuser/timm/models/nfnet.py | """ Normalization Free Nets. NFNet, NF-RegNet, NF-ResNet (pre-activation) Models
Paper: `Characterizing signal propagation to close the performance gap in unnormalized ResNets`
- https://arxiv.org/abs/2101.08692
Paper: `High-Performance Large-Scale Image Recognition Without Normalization`
- https://arxiv.org/... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/factory.py | interfuser/timm/models/factory.py | from .registry import is_model, is_model_in_modules, model_entrypoint
from .helpers import load_checkpoint
from .layers import set_layer_config
from .hub import load_model_config_from_hf
def split_model_name(model_name):
model_split = model_name.split(":", 1)
if len(model_split) == 1:
return "", model... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/interfuser.py | interfuser/timm/models/interfuser.py | import math
import copy
import torch
from torch import nn, Tensor
import torch.nn.functional as F
import torch.nn as nn
from functools import partial
import numpy
import numpy as np
import logging
from typing import Optional, List
from collections import OrderedDict
from .registry import register_model
from .resnet imp... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/twins.py | interfuser/timm/models/twins.py | """ Twins
A PyTorch impl of : `Twins: Revisiting the Design of Spatial Attention in Vision Transformers`
- https://arxiv.org/pdf/2104.13840.pdf
Code/weights from https://github.com/Meituan-AutoML/Twins, original copyright/license info below
"""
# --------------------------------------------------------
# Twins
# ... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/__init__.py | interfuser/timm/models/__init__.py | from .byoanet import *
from .byobnet import *
from .cait import *
from .coat import *
from .convit import *
from .cspnet import *
from .densenet import *
from .dla import *
from .dpn import *
from .efficientnet import *
from .ghostnet import *
from .gluon_resnet import *
from .gluon_xception import *
from .hardcorenas ... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/mlp_mixer.py | interfuser/timm/models/mlp_mixer.py | """ MLP-Mixer, ResMLP, and gMLP in PyTorch
This impl originally based on MLP-Mixer paper.
Official JAX impl: https://github.com/google-research/vision_transformer/blob/linen/vit_jax/models_mixer.py
Paper: 'MLP-Mixer: An all-MLP Architecture for Vision' - https://arxiv.org/abs/2105.01601
@article{tolstikhin2021,
t... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/senet.py | interfuser/timm/models/senet.py | """
SEResNet implementation from Cadene's pretrained models
https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/senet.py
Additional credit to https://github.com/creafz
Original model: https://github.com/hujie-frank/SENet
ResNet code gently borrowed from
https://github.com/pytorch/v... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/efficientnet_blocks.py | interfuser/timm/models/efficientnet_blocks.py | """ EfficientNet, MobileNetV3, etc Blocks
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
import torch.nn as nn
from torch.nn import functional as F
from .layers import create_conv2d, drop_path, make_divisible, create_act_layer
from .layers.activations import sigmoid
__all__ = [
"SqueezeExcit... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/xcit.py | interfuser/timm/models/xcit.py | """ Cross-Covariance Image Transformer (XCiT) in PyTorch
Same as the official implementation, with some minor adaptations.
- https://github.com/facebookresearch/xcit/blob/master/xcit.py
Paper:
- https://arxiv.org/abs/2106.09681
"""
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import ma... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | true |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/resnet2.py | interfuser/timm/models/resnet2.py | import torch
from torch import Tensor
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
# https://zhuanlan.zhihu.com/p/225597229
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/convit.py | interfuser/timm/models/convit.py | """ ConViT Model
@article{d2021convit,
title={ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases},
author={d'Ascoli, St{\'e}phane and Touvron, Hugo and Leavitt, Matthew and Morcos, Ari and Biroli, Giulio and Sagun, Levent},
journal={arXiv preprint arXiv:2103.10697},
year={2021}
}
P... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/inception_resnet_v2.py | interfuser/timm/models/inception_resnet_v2.py | """ Pytorch Inception-Resnet-V2 implementation
Sourced from https://github.com/Cadene/tensorflow-model-zoo.torch (MIT License) which is
based upon Google's Tensorflow implementation and pretrained weights (Apache 2.0 License)
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import ... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/cspnet.py | interfuser/timm/models/cspnet.py | """PyTorch CspNet
A PyTorch implementation of Cross Stage Partial Networks including:
* CSPResNet50
* CSPResNeXt50
* CSPDarkNet53
* and DarkNet53 for good measure
Based on paper `CSPNet: A New Backbone that can Enhance Learning Capability of CNN` - https://arxiv.org/abs/1911.11929
Reference impl via darknet cfg file... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/transfuser_config.py | interfuser/timm/models/transfuser_config.py | import os
class GlobalConfig:
""" base architecture configurations """
# Data
seq_len = 1 # input timesteps
pred_len = 4 # future waypoints predicted
root_dir = '/mnt/qb/geiger/kchitta31/data_06_21'
train_towns = ['Town01', 'Town02', 'Town03', 'Town04', 'Town06', 'Town07', 'Town10']
val_towns... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/coat.py | interfuser/timm/models/coat.py | """
CoaT architecture.
Paper: Co-Scale Conv-Attentional Image Transformers - https://arxiv.org/abs/2104.06399
Official CoaT code at: https://github.com/mlpc-ucsd/CoaT
Modified from timm/models/vision_transformer.py
"""
from copy import deepcopy
from functools import partial
from typing import Tuple, List
import to... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/regnet.py | interfuser/timm/models/regnet.py | """RegNet
Paper: `Designing Network Design Spaces` - https://arxiv.org/abs/2003.13678
Original Impl: https://github.com/facebookresearch/pycls/blob/master/pycls/models/regnet.py
Based on original PyTorch impl linked above, but re-wrote to use my own blocks (adapted from ResNet here)
and cleaned up with more descripti... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/tresnet.py | interfuser/timm/models/tresnet.py | """
TResNet: High Performance GPU-Dedicated Architecture
https://arxiv.org/pdf/2003.13630.pdf
Original model: https://github.com/mrT23/TResNet
"""
from collections import OrderedDict
import torch
import torch.nn as nn
from .helpers import build_model_with_cfg
from .layers import SpaceToDepthModule, BlurPool2d, Inpl... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/sknet.py | interfuser/timm/models/sknet.py | """ Selective Kernel Networks (ResNet base)
Paper: Selective Kernel Networks (https://arxiv.org/abs/1903.06586)
This was inspired by reading 'Compounding the Performance Improvements...' (https://arxiv.org/abs/2001.06268)
and a streamlined impl at https://github.com/clovaai/assembled-cnn but I ended up building somet... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/densenet.py | interfuser/timm/models/densenet.py | """Pytorch Densenet implementation w/ tweaks
This file is a copy of https://github.com/pytorch/vision 'densenet.py' (BSD-3-Clause) with
fixed kwargs passthrough and addition of dynamic global avg/max pool.
"""
import re
from collections import OrderedDict
from functools import partial
import torch
import torch.nn as n... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
tulerfeng/PlanKD | https://github.com/tulerfeng/PlanKD/blob/7b6f542ad2b173f20d8baa0f78f83f652065d5ff/interfuser/timm/models/features.py | interfuser/timm/models/features.py | """ PyTorch Feature Extraction Helpers
A collection of classes, functions, modules to help extract features from models
and provide a common interface for describing them.
The return_layers, module re-writing idea inspired by torchvision IntermediateLayerGetter
https://github.com/pytorch/vision/blob/d88d8961ae51507d0... | python | Apache-2.0 | 7b6f542ad2b173f20d8baa0f78f83f652065d5ff | 2026-01-05T07:09:10.481895Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.