Skip to content
Snippets Groups Projects
Commit ab5074f0 authored by adip00's avatar adip00
Browse files

fixed deprecation errors (np.int -> np.int32 and np.float -> np.float32)

parent 13aaa43e
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ def non_max_suppression(boxes, max_bbox_overlap, scores=None):
if len(boxes) == 0:
return []
boxes = boxes.astype(np.float)
boxes = boxes.astype(np.float32)
pick = []
x1 = boxes[:, 0]
......
......@@ -113,7 +113,7 @@ class Visualization(object):
self.viewer.thickness = 2
for track_id, box in zip(track_ids, boxes):
self.viewer.color = create_unique_color_uchar(track_id)
self.viewer.rectangle(*box.astype(np.int), label=str(track_id))
self.viewer.rectangle(*box.astype(np.int32), label=str(track_id))
def draw_detections(self, detections):
self.viewer.thickness = 2
......@@ -128,7 +128,7 @@ class Visualization(object):
continue
self.viewer.color = create_unique_color_uchar(track.track_id)
self.viewer.rectangle(
*track.to_tlwh().astype(np.int), label=str(track.track_id))
*track.to_tlwh().astype(np.int32), label=str(track.track_id))
# self.viewer.gaussian(track.mean[:2], track.covariance[:2, :2],
# label="%d" % track.track_id)
#
pip install opencv-python==4.6.0.66 --verbose #use this version if stuck in builing-wheel-loop
pip install tensorflow==1.5
pip install scikit-learn==0.22 #use this version if you want to use original deepsort code, as it uses 'linear_assignment' that is deprecated in the recent versions
python3 tools/generate_detections.py --model=resources/networks/mars-small128.pb --mot_dir=./data/train --output_dir=./resources/detections/
python3 deep_sort_app.py --sequence_dir=./data/train/Hens --detection_file=./resources/detections/Hens.npy --min_confidence=0.3 --nn_budget=100 --display=True
python3 deep_sort_app.py --sequence_dir=./data/train/Hens --detection_file=./resources/detections/Hens.npy --min_confidence=0.3 --nn_budget=100 --display=False --output_file=./hens_output
pip install opencv-python==4.6.0.66 --verbose #use this version if stuck in builing-wheel-loop
pip install tensorflow==1.5
pip install scikit-learn==0.22 #use this version if you want to use original deepsort code, as it uses 'linear_assignment' that is deprecated in the recent versions
python3 tools/generate_detections.py --model=resources/networks/mars-small128.pb --mot_dir=./../sort/mot_benchmark/train --output_dir=./resources/detections/
python3 deep_sort_app.py --sequence_dir=./../sort/mot_benchmark/train/Hens --detection_file=./resources/detections/Hens.npy --min_confidence=0.3 --nn_budget=100 --display=True
python3 deep_sort_app.py --sequence_dir=./../sort/mot_benchmark/train/Hens --detection_file=./resources/detections/Hens.npy --min_confidence=0.3 --nn_budget=100 --display=False --output_file=./hens_output
\ No newline at end of file
......@@ -27,7 +27,7 @@ class Detection(object):
"""
def __init__(self, tlwh, confidence, feature):
self.tlwh = np.asarray(tlwh, dtype=np.float)
self.tlwh = np.asarray(tlwh, dtype=np.float32)
self.confidence = float(confidence)
self.feature = np.asarray(feature, dtype=np.float32)
......
......@@ -114,7 +114,7 @@ def create_detections(detection_mat, frame_idx, min_height=0):
Returns detection responses at given frame index.
"""
frame_indices = detection_mat[:, 0].astype(np.int)
frame_indices = detection_mat[:, 0].astype(np.int32)
mask = frame_indices == frame_idx
detection_list = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment