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

41 lines
1.2 KiB
Python
Raw Permalink 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_resrgan import UpscaleRealESRGANStage
from onnx_web.params import HighresParams, StageParams, 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-real-esrgan-x4-v3"
class UpscaleRealESRGANStageTests(unittest.TestCase):
@test_needs_onnx_models([TEST_MODEL])
def test_empty(self):
stage = UpscaleRealESRGANStage()
sources = StageResult.empty()
result = stage.run(
WorkerContext(
"test",
test_device(),
None,
None,
None,
None,
None,
None,
3,
0.1,
),
ServerContext(model_path="../models"),
StageParams(),
None,
sources,
highres=HighresParams(False, 1, 0, 0),
upscale=UpscaleParams("upscaling-real-esrgan-x4-v3"),
)
2024-01-06 02:13:57 +00:00
result.validate()
2023-11-23 17:19:58 +00:00
self.assertEqual(len(result), 0)