Skip to content

Commit

Permalink
update sys path
Browse files Browse the repository at this point in the history
  • Loading branch information
maudzung committed Jan 2, 2021
1 parent a32e2fe commit 38274d2
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ results/
dataset/
checkpoints/
logs/
src/.idea/
*.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ torchsummary==1.5.1
tensorboard==2.2.1
scikit-learn==0.22.2
wget==3.2
tqdm==4.54.0
matplotlib=3.3.3
119 changes: 0 additions & 119 deletions setup.py

This file was deleted.

14 changes: 9 additions & 5 deletions sfa/data_process/demo_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
import cv2
import torch

sys.path.append('../')

from sfa.data_process.kitti_data_utils import get_filtered_lidar
from sfa.data_process.kitti_bev_utils import makeBEVMap
import sfa.config.kitti_config as cnf
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from data_process.kitti_data_utils import get_filtered_lidar
from data_process.kitti_bev_utils import makeBEVMap
import config.kitti_config as cnf


class Demo_KittiDataset(Dataset):
Expand Down
9 changes: 7 additions & 2 deletions sfa/data_process/kitti_bev_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
"""

import math
import os
import sys

import cv2
import numpy as np

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

import sfa.config.kitti_config as cnf
import config.kitti_config as cnf


def makeBEVMap(PointCloud_, boundary):
Expand Down
9 changes: 7 additions & 2 deletions sfa/data_process/kitti_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
"""

from __future__ import print_function
import os
import sys

import numpy as np
import cv2

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

import sfa.config.kitti_config as cnf
import config.kitti_config as cnf


class Object3d(object):
Expand Down
11 changes: 8 additions & 3 deletions sfa/data_process/kitti_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@
# Description: This script for creating the dataloader for training/validation/test phase
"""

import os
import sys

import torch
from torch.utils.data import DataLoader
import numpy as np

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from sfa.data_process.kitti_dataset import KittiDataset
from sfa.data_process.transformation import OneOf, Random_Rotation, Random_Scaling
from data_process.kitti_dataset import KittiDataset
from data_process.transformation import OneOf, Random_Rotation, Random_Scaling


def create_train_dataloader(configs):
Expand Down
16 changes: 10 additions & 6 deletions sfa/data_process/kitti_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
import cv2
import torch

sys.path.append('../')

from sfa.data_process.kitti_data_utils import gen_hm_radius, compute_radius, Calibration, get_filtered_lidar
from sfa.data_process.kitti_bev_utils import makeBEVMap, drawRotatedBox, get_corners
from sfa.data_process import transformation
import sfa.config.kitti_config as cnf
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from data_process.kitti_data_utils import gen_hm_radius, compute_radius, Calibration, get_filtered_lidar
from data_process.kitti_bev_utils import makeBEVMap, drawRotatedBox, get_corners
from data_process import transformation
import config.kitti_config as cnf


class KittiDataset(Dataset):
Expand Down
9 changes: 7 additions & 2 deletions sfa/data_process/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
# Refer: https://github.com/ghimiredhikura/Complex-YOLOv3
# Source : https://github.com/jeasinema/VoxelNet-tensorflow/blob/master/utils/utils.py
"""
import os
import sys
import math

import numpy as np
import torch

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from sfa.config import kitti_config as cnf
from config import kitti_config as cnf


def angle_in_limit(angle):
Expand Down
24 changes: 14 additions & 10 deletions sfa/demo_2_sides.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
import torch
import numpy as np

sys.path.append('./')

from sfa.data_process.demo_dataset import Demo_KittiDataset
from sfa.models.model_utils import create_model
from sfa.utils.evaluation_utils import draw_predictions, convert_det_to_real_values
import sfa.config.kitti_config as cnf
from sfa.data_process.transformation import lidar_to_camera_box
from sfa.utils.visualization_utils import show_rgb_image_with_boxes
from sfa.data_process.kitti_data_utils import Calibration
from sfa.utils.demo_utils import parse_demo_configs, do_detect, download_and_unzip, write_credit
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from data_process.demo_dataset import Demo_KittiDataset
from models.model_utils import create_model
from utils.evaluation_utils import draw_predictions, convert_det_to_real_values
import config.kitti_config as cnf
from data_process.transformation import lidar_to_camera_box
from utils.visualization_utils import show_rgb_image_with_boxes
from data_process.kitti_data_utils import Calibration
from utils.demo_utils import parse_demo_configs, do_detect, download_and_unzip, write_credit

if __name__ == '__main__':
configs = parse_demo_configs()
Expand Down
24 changes: 14 additions & 10 deletions sfa/demo_front.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
import torch
import numpy as np

sys.path.append('./')

from sfa.data_process.demo_dataset import Demo_KittiDataset
from sfa.models.model_utils import create_model
from sfa.utils.evaluation_utils import draw_predictions, convert_det_to_real_values
import sfa.config.kitti_config as cnf
from sfa.data_process.transformation import lidar_to_camera_box
from sfa.utils.visualization_utils import merge_rgb_to_bev, show_rgb_image_with_boxes
from sfa.data_process.kitti_data_utils import Calibration
from sfa.utils.demo_utils import parse_demo_configs, do_detect, download_and_unzip, write_credit
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from data_process.demo_dataset import Demo_KittiDataset
from models.model_utils import create_model
from utils.evaluation_utils import draw_predictions, convert_det_to_real_values
import config.kitti_config as cnf
from data_process.transformation import lidar_to_camera_box
from utils.visualization_utils import merge_rgb_to_bev, show_rgb_image_with_boxes
from data_process.kitti_data_utils import Calibration
from utils.demo_utils import parse_demo_configs, do_detect, download_and_unzip, write_credit

if __name__ == '__main__':
configs = parse_demo_configs()
Expand Down
9 changes: 7 additions & 2 deletions sfa/losses/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@
# Modified by Nguyen Mau Dung (2020.08.09)
# ------------------------------------------------------------------------------

import os
import sys
import math

import torch.nn as nn
import torch
import torch.nn.functional as F

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from sfa.utils.torch_utils import to_cpu, _sigmoid
from utils.torch_utils import to_cpu, _sigmoid


def _gather_feat(feat, ind, mask=None):
Expand Down
9 changes: 7 additions & 2 deletions sfa/models/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
# Description: utils functions that use for model
"""

import os
import sys

import torch

sys.path.append('../')
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)

from sfa.models import resnet, fpn_resnet
from models import resnet, fpn_resnet


def create_model(configs):
Expand Down
Loading

0 comments on commit 38274d2

Please sign in to comment.