forked from quic/ai-hub-models
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.py
26 lines (21 loc) · 893 Bytes
/
demo.py
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
# ---------------------------------------------------------------------
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------------
from qai_hub_models.models._shared.detr.demo import detr_demo
from qai_hub_models.models.detr_resnet50.model import (
DEFAULT_WEIGHTS,
MODEL_ASSET_VERSION,
MODEL_ID,
DETRResNet50,
)
from qai_hub_models.utils.asset_loaders import CachedWebModelAsset
IMAGE_ADDRESS = CachedWebModelAsset.from_asset_store(
MODEL_ID, MODEL_ASSET_VERSION, "detr_demo_image.jpg"
)
# Run DETR app end-to-end on a sample image.
# The demo will display the predicted mask in a window.
def main(is_test: bool = False):
detr_demo(DETRResNet50, MODEL_ID, DEFAULT_WEIGHTS, IMAGE_ADDRESS, is_test)
if __name__ == "__main__":
main()