diff --git a/media/MetadataViewer/index.js b/media/MetadataViewer/index.js index 01f33421c..2fd0c7a49 100644 --- a/media/MetadataViewer/index.js +++ b/media/MetadataViewer/index.js @@ -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"); @@ -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"); diff --git a/media/MetadataViewer/style.css b/media/MetadataViewer/style.css index 9bb1eb997..4a036b29f 100644 --- a/media/MetadataViewer/style.css +++ b/media/MetadataViewer/style.css @@ -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; diff --git a/src/MetadataViewer/example/MetadataExample.ts b/src/MetadataViewer/example/MetadataExample.ts index 93cead761..5149afcab 100644 --- a/src/MetadataViewer/example/MetadataExample.ts +++ b/src/MetadataViewer/example/MetadataExample.ts @@ -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"], + "Target Arch": "2.4.3:T4", + "Origins": [ + [ "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" ] + ], }, }; } diff --git a/src/OneExplorer/ConfigObject.ts b/src/OneExplorer/ConfigObject.ts index 638f4a0ea..c4ab1468e 100644 --- a/src/OneExplorer/ConfigObject.ts +++ b/src/OneExplorer/ConfigObject.ts @@ -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)