예제 #1
0
파일: py_test.py 프로젝트: spillai/scanner
def test_lossless(cl):
    input = NamedVideoStream(cl, 'test1')
    frame = cl.io.Input([input])
    range_frame = cl.streams.Range(frame, ranges=[{'start': 0, 'end': 30}])
    blurred_frame = cl.ops.Blur(frame=range_frame, kernel_size=3, sigma=0.1)
    output = NamedVideoStream(cl, 'test_blur')
    output_op = cl.io.Output(blurred_frame.lossless(), [output])
    cl.run(output_op,
           PerfParams.estimate(),
           cache_mode=CacheMode.Overwrite,
           show_progress=False)
    next(output.load())
예제 #2
0
파일: py_test.py 프로젝트: spillai/scanner
    def run_sampler_job(sampler, sampler_args, expected_rows):
        frame = cl.io.Input([NamedVideoStream(cl, 'test1')])
        sample_frame = sampler(input=frame, **sampler_args)
        output = NamedVideoStream(cl, 'test_sample')
        output_op = cl.io.Output(sample_frame, [output])
        cl.run(output_op,
               PerfParams.estimate(),
               cache_mode=CacheMode.Overwrite,
               show_progress=False)

        num_rows = len(list(output.load()))
        assert num_rows == expected_rows
예제 #3
0
파일: py_test.py 프로젝트: spillai/scanner
def test_stream_args(cl):
    frame = cl.io.Input([NamedVideoStream(cl, 'test1')])
    resized_frame = cl.ops.Resize(frame=frame, width=[640], height=[480])
    range_frame = cl.streams.Range(resized_frame, [(0, 10)])
    output_stream = NamedVideoStream(cl, 'test_stream_args')
    output_op = cl.io.Output(range_frame, [output_stream])
    cl.run(output_op,
           PerfParams.estimate(),
           cache_mode=CacheMode.Overwrite,
           show_progress=False)

    list(output_stream.load())
예제 #4
0
def test_py_variadic(cl):
    input = NamedVideoStream(cl, 'test1')
    frame = cl.io.Input([input])
    range_frame = cl.streams.Range(frame, ranges=[{'start': 0, 'end': 30}])
    out_frame = cl.ops.TestPyVariadic(range_frame, range_frame, range_frame)
    output = NamedVideoStream(cl, 'test_variadic')
    output_op = cl.io.Output(out_frame.lossless(), [output])
    cl.run(output_op,
           PerfParams.estimate(),
           cache_mode=CacheMode.Overwrite,
           show_progress=False)
    next(output.load())