Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _load_raw_file(self, tracker, seq, is_gt):
time_key = str(t + 1)
if time_key in read_data.keys():
try:
time_data = np.asarray(read_data[time_key], dtype=np.float)
time_data = np.asarray(read_data[time_key], dtype=float)
except ValueError:
if is_gt:
raise TrackEvalException(
Expand Down
4 changes: 2 additions & 2 deletions external/TrackEval/trackeval/datasets/kitti_2d_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _load_raw_file(self, tracker, seq, is_gt):
for t in range(num_timesteps):
time_key = str(t)
if time_key in read_data.keys():
time_data = np.asarray(read_data[time_key], dtype=np.float)
time_data = np.asarray(read_data[time_key], dtype=float)
raw_data["dets"][t] = np.atleast_2d(time_data[:, 6:10])
raw_data["ids"][t] = np.atleast_1d(time_data[:, 1]).astype(int)
raw_data["classes"][t] = np.atleast_1d(time_data[:, 2]).astype(int)
Expand Down Expand Up @@ -277,7 +277,7 @@ def _load_raw_file(self, tracker, seq, is_gt):
raw_data["tracker_confidences"][t] = np.empty(0)
if is_gt:
if time_key in ignore_data.keys():
time_ignore = np.asarray(ignore_data[time_key], dtype=np.float)
time_ignore = np.asarray(ignore_data[time_key], dtype=float)
raw_data["gt_crowd_ignore_regions"][t] = np.atleast_2d(
time_ignore[:, 6:10]
)
Expand Down
12 changes: 6 additions & 6 deletions external/TrackEval/trackeval/metrics/track_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ def combine_sequences(self, all_res):
tps = np.logical_and(dt_m != -1, np.logical_not(dt_ig))
fps = np.logical_and(dt_m == -1, np.logical_not(dt_ig))

tp_sum = np.cumsum(tps, axis=1).astype(dtype=np.float)
fp_sum = np.cumsum(fps, axis=1).astype(dtype=np.float)
tp_sum = np.cumsum(tps, axis=1).astype(dtype=float)
fp_sum = np.cumsum(fps, axis=1).astype(dtype=float)

for iou_thr_idx, (tp, fp) in enumerate(zip(tp_sum, fp_sum)):
tp = np.array(tp)
Expand Down Expand Up @@ -315,8 +315,8 @@ def combine_sequences(self, all_res):

# compute the precision and recall averages for the respective alpha thresholds and ignore masks
for lbl in self.lbls:
res["AP_" + lbl] = np.zeros((len(self.array_labels)), dtype=np.float)
res["AR_" + lbl] = np.zeros((len(self.array_labels)), dtype=np.float)
res["AP_" + lbl] = np.zeros((len(self.array_labels)), dtype=float)
res["AR_" + lbl] = np.zeros((len(self.array_labels)), dtype=float)

for a_id, alpha in enumerate(self.array_labels):
for lbl_idx, lbl in enumerate(self.lbls):
Expand All @@ -336,7 +336,7 @@ def combine_classes_class_averaged(self, all_res, ignore_empty_classes=True):
"""
res = {}
for field in self.fields:
res[field] = np.zeros((len(self.array_labels)), dtype=np.float)
res[field] = np.zeros((len(self.array_labels)), dtype=float)
field_stacked = np.array([res[field] for res in all_res.values()])

for a_id, alpha in enumerate(self.array_labels):
Expand All @@ -353,7 +353,7 @@ def combine_classes_det_averaged(self, all_res):

res = {}
for field in self.fields:
res[field] = np.zeros((len(self.array_labels)), dtype=np.float)
res[field] = np.zeros((len(self.array_labels)), dtype=float)
field_stacked = np.array([res[field] for res in all_res.values()])

for a_id, alpha in enumerate(self.array_labels):
Expand Down
26 changes: 26 additions & 0 deletions external/deep-person-reid/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[build-system]
requires = [
"setuptools",
"wheel",
"numpy",
"cython",
]
build-backend = "setuptools.build_meta"

[project]
name = "torchreid"
dynamic = [
"version",
"description",
"authors",
"readme",
"dependencies",
"keywords",
]

[tool.setuptools.dynamic]
version = {attr = "torchreid.__version__"}
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
include = ["torchreid"]
13 changes: 1 addition & 12 deletions external/deep-person-reid/setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import numpy as np
import os.path as osp
from setuptools import setup, find_packages
from distutils.extension import Extension
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize


def readme():
with open("README.rst") as f:
content = f.read()
return content


def find_version():
version_file = "torchreid/__init__.py"
with open(version_file, "r") as f:
exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"]


def numpy_include():
try:
numpy_include = np.get_include()
Expand All @@ -43,8 +34,6 @@ def get_requirements(filename="requirements.txt"):


setup(
name="torchreid",
version=find_version(),
description="A library for deep learning person re-ID in PyTorch",
author="Kaiyang Zhou",
license="MIT",
Expand Down
4 changes: 2 additions & 2 deletions models/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def __init__(self, point_dim=4, context_dim=256, tf_layer=3, residual=False):
self.concat1 = MFL(4, context_dim // 2, context_dim+3)
self.concat1_2 = MFL(context_dim // 2, context_dim, context_dim + 3)
self.concat1_3 = MFL(context_dim, 2 * context_dim, context_dim + 3)
self.layer = nn.TransformerEncoderLayer(d_model=2*context_dim, nhead=4, dim_feedforward=4*context_dim)
self.layer = nn.TransformerEncoderLayer(d_model=2*context_dim, nhead=4, dim_feedforward=4*context_dim, batch_first=True)
self.transformer_encoder = nn.TransformerEncoder(self.layer, num_layers=tf_layer)
self.layer2 = nn.TransformerEncoderLayer(d_model=context_dim, nhead=4, dim_feedforward=2 * context_dim)
self.layer2 = nn.TransformerEncoderLayer(d_model=context_dim, nhead=4, dim_feedforward=2 * context_dim, batch_first=True)
self.transformer_encoder2 = nn.TransformerEncoder(self.layer2, num_layers=tf_layer)
self.concat3 = MFL(2*context_dim,context_dim, context_dim+3)
self.concat4 = MFL(context_dim,context_dim//2, context_dim+3)
Expand Down
1 change: 0 additions & 1 deletion requirement.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
einops
pyyaml
argparse
easydict
numpy
tensorboardX
Expand Down
2 changes: 1 addition & 1 deletion tracker/DiffMOTtracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, tlwh, score, temp_feat=None, buffer_size=30):
self.conds = deque([], maxlen=5)


self._tlwh = np.asarray(tlwh, dtype=np.float)
self._tlwh = np.asarray(tlwh, dtype=float)
self.kalman_filter = None
self.mean, self.covariance = None, None
self.is_activated = False
Expand Down
2 changes: 1 addition & 1 deletion tracker/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def initialize_model(self):
path = "external/weights/dance_sbs_S50.pth"
# path = "/home/estar/lwy/DiffMOT/external/weights/dancetrack_sbs_S50_hybtid.pth"
elif self.dataset == "sports":
path = "/home/estar/lwy/BoT-SORT-main/fast_reid/tools/logs/SportsMOT/sbs_S50/model_0058.pth"
path = "external/weights/sports_sbs_S50.pth"
else:
raise RuntimeError("Need the path for a new ReID model.")

Expand Down
12 changes: 6 additions & 6 deletions tracker/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def ious(atlbrs, btlbrs):

:rtype ious np.ndarray
"""
ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=np.float)
ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=float)
if ious.size == 0:
return ious

ious = bbox_ious(
np.ascontiguousarray(atlbrs, dtype=np.float),
np.ascontiguousarray(btlbrs, dtype=np.float)
np.ascontiguousarray(atlbrs, dtype=float),
np.ascontiguousarray(btlbrs, dtype=float)
)

return ious
Expand Down Expand Up @@ -189,13 +189,13 @@ def embedding_distance(tracks, detections, metric='cosine'):
:return: cost_matrix np.ndarray
"""

cost_matrix = np.zeros((len(tracks), len(detections)), dtype=np.float)
cost_matrix = np.zeros((len(tracks), len(detections)), dtype=float)
if cost_matrix.size == 0:
return cost_matrix
det_features = np.asarray([track.curr_feat for track in detections], dtype=np.float)
det_features = np.asarray([track.curr_feat for track in detections], dtype=float)
#for i, track in enumerate(tracks):
#cost_matrix[i, :] = np.maximum(0.0, cdist(track.smooth_feat.reshape(1,-1), det_features, metric))
track_features = np.asarray([track.smooth_feat for track in tracks], dtype=np.float)
track_features = np.asarray([track.smooth_feat for track in tracks], dtype=float)
cost_matrix = np.maximum(0.0, cdist(track_features, det_features, metric)) # Nomalized features
return cost_matrix

Expand Down