forked from ucla-mobility/OpenCDA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ace7312
commit c56eee0
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ python: | |
|
||
install: | ||
- pip install --upgrade pip | ||
- pip install -r requirements.txt | ||
- pip install -r requirements_ci.txt | ||
- pip install pytest | ||
- pip install pytest-cov | ||
- pip install coveralls | ||
|
@@ -23,5 +23,5 @@ notifications: | |
email: | ||
recipients: | ||
- [email protected] | ||
on_success: change # default: change | ||
on_success: never # default: change | ||
on_failure: always # default: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Unit test for ML Manager. | ||
""" | ||
# Author: Runsheng Xu <[email protected]> | ||
# License: MIT | ||
|
||
import os | ||
import sys | ||
import unittest | ||
|
||
import cv2 | ||
import numpy as np | ||
|
||
# temporary solution for relative imports in case opencda is not installed | ||
# if opencda is installed, no need to use the following line | ||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | ||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '.'))) | ||
|
||
from opencda.customize.ml_libs.ml_manager import MLManager | ||
|
||
|
||
class TestMlManager(unittest.TestCase): | ||
def setUp(self): | ||
current_path = os.path.dirname(os.path.realpath(__file__)) | ||
self.data = cv2.imread(os.path.join(current_path, 'data/test.jpg')) | ||
self.ml_manager = MLManager() | ||
|
||
def test_parameters(self): | ||
assert self.ml_manager.object_detector | ||
|
||
def test_draw_2d_bbx(self): | ||
results = self.ml_manager.object_detector(self.data) | ||
assert len(results) == 1 | ||
assert self.ml_manager.draw_2d_box(results, self.data, 0).shape == self.data.shape |