-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathdemo.py
More file actions
33 lines (27 loc) · 1021 Bytes
/
demo.py
File metadata and controls
33 lines (27 loc) · 1021 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
28
29
30
31
32
33
# ---------------------------------------------------------------------
# Copyright (c) 2025 Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------------
from qai_hub_models.models._shared.sam2.demo import sam2_demo_main
from qai_hub_models.models.edgetam.model import (
DEFAULT_MODEL_TYPE,
MODEL_ASSET_VERSION,
MODEL_ID,
EdgeTAM,
)
from qai_hub_models.utils.asset_loaders import CachedWebModelAsset
IMAGE_ADDRESS = CachedWebModelAsset.from_asset_store(
MODEL_ID, MODEL_ASSET_VERSION, "truck.jpg"
)
# Run EdgeTAM end-to-end model on given image.
# The demo will output image with segmentation mask applied for input points
def main(is_test: bool = False) -> None:
sam2_demo_main(
model_cls=EdgeTAM,
model_id=MODEL_ID,
default_image=IMAGE_ADDRESS,
default_model_type=DEFAULT_MODEL_TYPE,
is_test=is_test,
)
if __name__ == "__main__":
main()