1
0
Fork 0
onnx-web/api/tests/chain/test_upscale_swinir.py

42 lines
1.2 KiB
Python
Raw Normal View History

2023-11-23 17:19:58 +00:00
import unittest
from onnx_web.chain.result import StageResult
from onnx_web.chain.upscale_swinir import UpscaleSwinIRStage
from onnx_web.params import HighresParams, UpscaleParams
from onnx_web.server.context import ServerContext
from onnx_web.worker.context import WorkerContext
from tests.helpers import test_device, test_needs_onnx_models
TEST_MODEL = "../models/upscaling-swinir-real-large-x4"
class UpscaleSwinIRStageTests(unittest.TestCase):
@test_needs_onnx_models([TEST_MODEL])
def test_empty(self):
stage = UpscaleSwinIRStage()
sources = StageResult.empty()
result = stage.run(
WorkerContext(
"test",
test_device(),
None,
None,
None,
None,
None,
None,
3,
0.1,
),
ServerContext(
# model_path="../models",
),
None,
None,
sources,
highres=HighresParams(False, 1, 0, 0),
upscale=UpscaleParams(TEST_MODEL),
)
self.assertEqual(len(result), 0)