diff --git a/tools/model_explorer_circle/.gitignore b/tools/model_explorer_circle/.gitignore new file mode 100644 index 00000000000..31a8789d950 --- /dev/null +++ b/tools/model_explorer_circle/.gitignore @@ -0,0 +1,2 @@ +venv +src/*.egg-info/ diff --git a/tools/model_explorer_circle/README.md b/tools/model_explorer_circle/README.md new file mode 100644 index 00000000000..7da12c0e891 --- /dev/null +++ b/tools/model_explorer_circle/README.md @@ -0,0 +1,7 @@ +# Circle adapter for Model Explorer + +Circle adapter is an extension adapter for displaying a Circle model in Model Explorer. + +* [Model Explorer](https://github.com/google-ai-edge/model-explorer) + * Visulization tool for various type of model graphs such as onnx, tflite, pt2 and mlir. + diff --git a/tools/model_explorer_circle/src/circle_adapter/main.py b/tools/model_explorer_circle/src/circle_adapter/main.py new file mode 100644 index 00000000000..0fd9f543120 --- /dev/null +++ b/tools/model_explorer_circle/src/circle_adapter/main.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Model Explorer adapter for Circle models.""" + +from typing import Dict +from model_explorer import Adapter, AdapterMetadata, ModelExplorerGraphs, graph_builder + + +class CircleAdapter(Adapter): + """Adapter class for Circle models.""" + metadata = AdapterMetadata(id='circle-adapter', + name='Circle adapter', + description='Circle adapter!', + fileExts=['circle']) + + def __init__(self): + super().__init__() + + def convert(self, model_path: str, settings: Dict) -> ModelExplorerGraphs: + graph = graph_builder.Graph(id='main') + return {'graphs': [graph]}