Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled VAS OT in G-API Python interface
- Loading branch information
1 parent
850ebec
commit bf5c877
Showing
12 changed files
with
176 additions
and
54 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
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
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
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
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
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,67 @@ | ||
#!/usr/bin/env python | ||
|
||
import numpy as np | ||
import cv2 as cv | ||
import os | ||
import sys | ||
import unittest | ||
|
||
from tests_common import NewOpenCVTests | ||
|
||
|
||
try: | ||
|
||
if sys.version_info[:2] < (3, 0): | ||
raise unittest.SkipTest('Python 2.x is not supported') | ||
|
||
# Plaidml is an optional backend | ||
pkgs = [ | ||
('ocl' , cv.gapi.core.ocl.kernels()), | ||
('cpu' , cv.gapi.core.cpu.kernels()), | ||
('fluid' , cv.gapi.core.fluid.kernels()) | ||
# ('plaidml', cv.gapi.core.plaidml.kernels()) | ||
] | ||
|
||
|
||
class gapi_ot_test(NewOpenCVTests): | ||
|
||
def smoke_test_ot(self): | ||
# Input | ||
img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')]) | ||
in_image = cv.cvtColor(cv.imread(img_path), cv.COLOR_RGB2GRAY) | ||
in_rects = [ (138.0, 89.1, 71.3, 64.0) ] | ||
in_rects_cls = 0 | ||
|
||
# G-API | ||
g_in = cv.GMat() | ||
g_in_rects = cv.GArray.Rect() | ||
g_in_rect_cls = cv.GArray.Int() | ||
delta = 0.5 | ||
|
||
g_out_rects, g_out_rects_cls, g_track_ids, g_track_sts = \ | ||
cv.gapi.ot.track(g_in, g_in_rects, g_in_rect_cls, delta) | ||
|
||
|
||
comp = cv.GComputation(cv.GIn(g_in, g_in_rects, g_in_rects_cls), | ||
cv.GOut(g_out_rects, g_out_rects_cls, | ||
g_track_ids, g_track_sts)) | ||
|
||
res = comp.apply(cv.gin(in_image, in_rects, in_rects_cls), | ||
args=cv.gapi.compile_args(cv.gapi.ot.cpu.kernels())) | ||
|
||
except unittest.SkipTest as e: | ||
|
||
message = str(e) | ||
|
||
class TestSkip(unittest.TestCase): | ||
def setUp(self): | ||
self.skipTest('Skip tests: ' + message) | ||
|
||
def test_skip(): | ||
pass | ||
|
||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
NewOpenCVTests.bootstrap() |
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
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
Oops, something went wrong.