Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused lib in .py files #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
10 changes: 4 additions & 6 deletions src/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
from __future__ import division
from __future__ import print_function

import _init_paths

import logging
import os
import os.path as osp
from opts import opts
from tracking_utils.utils import mkdir_if_missing
from tracking_utils.log import logger

import datasets.dataset.jde as datasets
from opts import opts
from track import eval_seq

from tracking_utils.log import logger
from tracking_utils.utils import mkdir_if_missing

logger.setLevel(logging.INFO)

Expand Down
5 changes: 2 additions & 3 deletions src/gen_data_path.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import glob
import _init_paths
import os


def gen_caltech_path(root_path):
Expand All @@ -19,4 +18,4 @@ def gen_caltech_path(root_path):

if __name__ == '__main__':
root = '/data/yfzhang/MOT/JDE'
gen_caltech_path(root)
gen_caltech_path(root)
10 changes: 1 addition & 9 deletions src/lib/datasets/dataset/jde.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
from collections import OrderedDict

import cv2
import json
import numpy as np
import torch

from torch.utils.data import Dataset
from torchvision.transforms import transforms as T
from cython_bbox import bbox_overlaps as bbox_ious
from opts import opts
from utils.image import gaussian_radius, draw_umich_gaussian, draw_msra_gaussian
from utils.utils import xyxy2xywh, generate_anchors, xywh2xyxy, encode_delta
from utils.utils import xyxy2xywh


class LoadImages: # for inference
Expand Down Expand Up @@ -535,5 +529,3 @@ def __getitem__(self, files_index):
labels[i, 1] += self.tid_start_index[ds]

return imgs, labels0, img_path, (h, w)


3 changes: 2 additions & 1 deletion src/lib/models/networks/DCNv2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os
import glob

import torch

from torch.utils.cpp_extension import CUDA_HOME
Expand All @@ -14,6 +13,7 @@

requirements = ["torch", "torchvision"]


def get_extensions():
this_dir = os.path.dirname(os.path.abspath(__file__))
extensions_dir = os.path.join(this_dir, "src")
Expand Down Expand Up @@ -53,6 +53,7 @@ def get_extensions():
]
return ext_modules


setup(
name="DCNv2",
version="0.1",
Expand Down
18 changes: 7 additions & 11 deletions src/test_det.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@
from __future__ import division
from __future__ import print_function

import _init_paths
import argparse
import torch
import json
import time
import os
import cv2
import time

from sklearn import metrics
from scipy import interpolate
import numpy as np
from torchvision.transforms import transforms as T
from models.model import create_model, load_model
import torch
from datasets.dataset.jde import DetDataset, collate_fn
from utils.utils import xywh2xyxy, ap_per_class, bbox_iou
from opts import opts
from models.decode import mot_decode
from models.model import create_model, load_model
from opts import opts
from torchvision.transforms import transforms as T
from utils.post_process import ctdet_post_process
from utils.utils import xywh2xyxy, ap_per_class, bbox_iou


def post_process(opt, dets, meta):
Expand Down Expand Up @@ -208,6 +203,7 @@ def test_det(
# Return mAP
return mean_mAP, mean_R, mean_P


if __name__ == '__main__':
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
opt = opts().init()
Expand Down
21 changes: 8 additions & 13 deletions src/test_emb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,21 @@
from __future__ import division
from __future__ import print_function

import _init_paths
import argparse
import torch
import json
import time
import os
import cv2
import math
import os
import time

from sklearn import metrics
from scipy import interpolate
import numpy as np
from torchvision.transforms import transforms as T
import torch
import torch.nn.functional as F
from datasets.dataset.jde import JointDataset
from models.model import create_model, load_model
from datasets.dataset.jde import JointDataset, collate_fn
from models.utils import _tranpose_and_gather_feat
from utils.utils import xywh2xyxy, ap_per_class, bbox_iou
from opts import opts
from models.decode import mot_decode
from utils.post_process import ctdet_post_process
from scipy import interpolate
from sklearn import metrics
from torchvision.transforms import transforms as T


def test_emb(
Expand Down Expand Up @@ -104,6 +98,7 @@ def test_emb(
print('TPR@FAR={:.7f}: {:.4f}'.format(fa, tar_at_far[f]))
return tar_at_far


if __name__ == '__main__':
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
opt = opts().init()
Expand Down