-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools/model_explorer_circle] Introduce circle adapter for model expl… (
#14320) It adds the initial version of circle adapter for model explorer. It'll simply show a empty main graph when circle file is loaded. ONE-DCO-1.0-Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
venv | ||
src/*.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]} |