Skip to content

Commit

Permalink
Show TVN File information
Browse files Browse the repository at this point in the history
ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee <[email protected]>
  • Loading branch information
dayo09 committed Oct 10, 2023
1 parent 4aed26f commit 8b5b481
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 33 deletions.
52 changes: 50 additions & 2 deletions media/MetadataViewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function updateMetadataInfo(metadata) {

const viewItemHeader = document.createElement("div");
viewItemHeader.classList.add("view-item-header");
viewItemHeader.innerText = "Common";
viewItemHeader.innerText = "TVN File Information";

const viewItemShowButton = document.createElement("div");
viewItemShowButton.setAttribute("id", "common-view-item-show-button");
Expand All @@ -71,7 +71,55 @@ function updateMetadataInfo(metadata) {
const metadataInfo = metadata[mainFileName];

for (const subKey in metadataInfo) {
if (subKey === "operations") {
if (subKey === "Origins") {
const viewItemBox = document.createElement("div");
viewItemBox.setAttribute("id", "operations-view-item-box");
viewItemBox.classList.add("view-item-box");

// draw header
const viewItemHeader = document.createElement("div");
viewItemHeader.classList.add("view-item-header");
viewItemHeader.innerText = "Operation Origins";

// add show button image
const showButton = document.createElement("div");
showButton.classList.add(
"view-item-show-button",
"codicon-collapse-all",
"codicon"
);
showButton.setAttribute("id", "operations-view-item-show-button");

// draw a header box to hold headers and showButton
const viewItemHeaderBox = document.createElement("div");
viewItemHeaderBox.classList.add("view-item-header-box");

viewItemHeaderBox.append(viewItemHeader, showButton);
viewItemBox.appendChild(viewItemHeaderBox);
mainViewItemBox.appendChild(viewItemBox);

// draw content box
const viewItemContentBox = document.createElement("div");
viewItemContentBox.classList.add("view-item-content-box");
viewItemContentBox.setAttribute("id", "operations-view-content-box");
viewItemBox.appendChild(viewItemContentBox);

for (const operationsKey in metadataInfo[subKey]) {
if (
Object.prototype.hasOwnProperty.call(
metadataInfo[subKey],
operationsKey
)
) {
metadataDivCreate(
operationsKey,
metadataInfo[subKey][operationsKey],
"operations"
);
}
}
}
else if (subKey === "operations") {
const viewItemBox = document.createElement("div");
viewItemBox.setAttribute("id", "operations-view-item-box");
viewItemBox.classList.add("view-item-box");
Expand Down
2 changes: 1 addition & 1 deletion media/MetadataViewer/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ body.vscode-light .view-item-value {
padding: 10px;
margin-top: 20px;
margin-bottom: 10px;
font-size: 20px;
font-size: 16px;
font-weight: bold;
font-family: sans-serif;
color: #e7e7e7;
Expand Down
132 changes: 103 additions & 29 deletions src/MetadataViewer/example/MetadataExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,109 @@ TODO Replace this sample logic into real logic
export function getMetadata(_path: any) {
return {
"test.log": {
"file-extension": "log",
"created-time": new Date().toLocaleString(),
"modified-time": new Date().toLocaleString(),
"is-deleted": false,

"toolchain-version": "toolchain v1.3.0",
"onecc-version": "1.20.0",
operations: { "op-total": 50, ops: ["conv2d", "relu", "conv", "spp"] },
"cfg-settings": {
onecc: {
"one-import-tf": true,
"one-import-tflite": false,
"one-import-onnx": false,
"one-quantize": true,
},
"one-import-tf": {
"converter-version": "v2",
"input-array": "a",
"output-array": "a",
"input-shapes": "1,299,299",
},
"one-quantize": {
"quantized-dtype": "int16",
"input-data-format": "list",
"min-percentile": "11",
"max-percentile": "100",
mode: "movingAvg",
},
},
"Toolchain Version": ["one-compiler 1.24.0", "triv24-compiler 1.0.0", "triv24-mte 1.0.0", "npu-engine 2.6.1", "libmrpsim 3.9.20", "triv24-sim 1.3.2"],

Check warning on line 24 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-format

Object Literal Property name `Toolchain Version` must match one of the following formats: camelCase

Check warning on line 24 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-test

Object Literal Property name `Toolchain Version` must match one of the following formats: camelCase
"Target Arch": "2.4.3:T4",

Check warning on line 25 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-format

Object Literal Property name `Target Arch` must match one of the following formats: camelCase

Check warning on line 25 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-test

Object Literal Property name `Target Arch` must match one of the following formats: camelCase
"Origins": [

Check warning on line 26 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-format

Object Literal Property name `Origins` must match one of the following formats: camelCase

Check warning on line 26 in src/MetadataViewer/example/MetadataExample.ts

View workflow job for this annotation

GitHub Actions / check-test

Object Literal Property name `Origins` must match one of the following formats: camelCase
[ "UNet/enc1/Relu6" ],
[ "UNet/enc1/Relu6" ],
[ "UNet/enc1/Relu6" ],
[ "UNet/enc2/Relu6" ],
[ "UNet/enc1/Relu6" ],
[ "UNet/enc2/Relu6" ],
[ "UNet/enc2/Relu6" ],
[ "UNet/enc3/Relu6" ],
[ "UNet/enc2/Relu6" ],
[ "UNet/enc3/Relu6" ],
[ "UNet/enc3/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/enc3/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/enc3/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/enc4/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/enc4/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/enc4/Relu6" ],
[ "UNet/enc4/Relu6" ],
[ "UNet/enc5/Relu6" ],
[ "UNet/enc4/Relu6" ],
[ "UNet/enc5/Relu6" ],
[ "UNet/enc5/Relu6" ],
[ "UNet/enc5/Relu6" ],
[ "UNet/enc6/Relu6" ],
[ "UNet/enc5/Relu6" ],
[ "UNet/enc6/Relu6" ],
[ "UNet/enc6/Relu6" ],
[ "UNet/dec6/Relu6/TransposeConv" ],
[ "UNet/enc6/Relu6" ],
[ "UNet/dec6/Relu6/TransposeConv" ],
[],
[ "UNet/dec6/Relu6/TransposeConv" ],
[ "UNet/dec6/Relu6/Relu6" ],
[ "UNet/dec6/Relu6/Relu6" ],
[ "UNet/dec6/Relu6/Relu6" ],
[],
[],
[ "UNet/dec5/Relu6/TransposeConv" ],
[],
[ "UNet/dec5/Relu6/TransposeConv" ],
[ "UNet/dec5/Relu6/TransposeConv" ],
[],
[ "UNet/dec5/Relu6/TransposeConv" ],
[ "UNet/dec5/Relu6/Relu6" ],
[ "UNet/dec5/Relu6/Relu6" ],
[ "UNet/dec5/Relu6/Relu6" ],
[],
[],
[ "UNet/dec4/Relu6/TransposeConv" ],
[],
[ "UNet/dec4/Relu6/TransposeConv" ],
[ "UNet/dec4/Relu6/TransposeConv" ],
[],
[ "UNet/dec4/Relu6/TransposeConv" ],
[ "UNet/dec4/Relu6/Relu6" ],
[ "UNet/dec4/Relu6/Relu6" ],
[ "UNet/dec4/Relu6/Relu6" ],
[],
[],
[ "UNet/dec3/Relu6/TransposeConv" ],
[],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/TransposeConv" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/dec3/Relu6/Relu6" ],
[ "UNet/depthwise" ],
[ "UNet/depthwise" ],
[],
[ "UNet/depthwise" ],
[ "UNet/depthwise" ],
[],
[],
[ "UNet/dec2_1/Relu6/TransposeConv" ],
[],
[ "UNet/dec2_1/Relu6/TransposeConv" ],
[ "UNet/dec2_1/Relu6/TransposeConv" ],
[ "UNet/dec1_1/conv2d_transpose" ],
[ "UNet/dec2_1/Relu6/TransposeConv" ],
[ "UNet/dec2_1/Relu6/Relu6" ],
[ "UNet/dec2_1/Relu6/Relu6" ],
[ "UNet/dec1_1/conv2d_transpose" ],
[ "UNet/dec1_1/conv2d_transpose" ],
[ "UNet/dec1_1/conv2d_transpose" ],
[ "mask_flatten" ],
[ "mask_flatten" ]
],
},
};
}
2 changes: 1 addition & 1 deletion src/OneExplorer/ConfigObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export class ConfigObj {
artifactAttr: {
ext: ".tvn",
icon: new vscode.ThemeIcon("symbol-variable"),
openViewType: "default",
openViewType: "one.viewer.metadata",
},
locator: new Locator((value: string) =>
LocatorRunner.searchWithExt(".tvn", value)
Expand Down

0 comments on commit 8b5b481

Please sign in to comment.