-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathdemo.py
More file actions
27 lines (21 loc) · 947 Bytes
/
demo.py
File metadata and controls
27 lines (21 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# ---------------------------------------------------------------------
# Copyright (c) 2025 Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------------
from qai_hub_models.models._shared.super_resolution.demo import super_resolution_demo
from qai_hub_models.models.esrgan.model import ESRGAN, MODEL_ASSET_VERSION, MODEL_ID
from qai_hub_models.utils.asset_loaders import CachedWebModelAsset
IMAGE_ADDRESS = CachedWebModelAsset.from_asset_store(
MODEL_ID, MODEL_ASSET_VERSION, "esrgan_demo.jpg"
)
# Run ESRGAN end-to-end on a sample image.
# The demo will display a image upscaled with no loss in quality.
def main(is_test: bool = False) -> None:
super_resolution_demo(
model_cls=ESRGAN,
model_id=MODEL_ID,
default_image=IMAGE_ADDRESS,
is_test=is_test,
)
if __name__ == "__main__":
main()