Browse Source

Request add ncnn::Mat support for Visual Studio Image Watch Tools (#625)

* add image watch plugin for image watch tools of visual studio

* add a new blank line as the end line
tags/20181228
kalcohol nihui 7 years ago
parent
commit
e38c5a69a6
3 changed files with 46 additions and 0 deletions
  1. +37
    -0
      tools/plugin/ImageWatchNCNN.natvis
  2. +9
    -0
      tools/plugin/README.md
  3. BIN
      tools/plugin/snapshot.png

+ 37
- 0
tools/plugin/ImageWatchNCNN.natvis View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>

<!-- Tencent NCNN ncnn::Mat support -->

<Type Name="ncnn::Mat">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
</Type>

<Type Name="ncnn::Mat">
<DisplayString Condition="elemsize==4">{{FLOAT32, {c} x {w} x {h}}}</DisplayString>
<DisplayString Condition="elemsize==2">{{FLOAT16, {c} x {w} x {h}}}</DisplayString>
<DisplayString Condition="elemsize==1">{{INT8, {c} x {w} x {h}}}</DisplayString>
<Expand>
<Synthetic Name="[type]" Condition="elemsize==4">
<DisplayString>FLOAT32</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition="elemsize==2">
<DisplayString>FLOAT16</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition="elemsize==1">
<DisplayString>INT8</DisplayString>
</Synthetic>
<Item Name="[channels]">c</Item>
<Item Name="[width]">w</Item>
<Item Name="[height]">h</Item>
<Item Name="[planes]">c</Item>
<Item Name="[data]" Condition="elemsize==4">((float*)(data))</Item>
<Item Name="[data]" Condition="elemsize==2">data</Item>
<Item Name="[data]" Condition="elemsize==1">data</Item>
<Item Name="[stride]" Condition="elemsize==1">w</Item>
<Item Name="[stride]" Condition="elemsize==2">w*2</Item>
<Item Name="[stride]" Condition="elemsize==4">w*4</Item>
</Expand>
</Type>
</AutoVisualizer>

+ 9
- 0
tools/plugin/README.md View File

@@ -0,0 +1,9 @@

## NCNN Image Watch Plugin for Visual Studio
Image Watch plugin is a good tool for better understanding insight of images. This tiny work offer a ".natvis" file which could add ncnn::Mat class support for Image Watch, and users could debug ncnn::Mat image just like debuging cv::Mat via Image Watch.

To use this plugin, please move this "ImageWatchNCNN.natvis" file to "C:/user/${your user name}/Documents/Visual Studio ${VS_Version}/Visualizers" folder. If not exist this folder, create it(such as: "C:\Users\nihui\Documents\Visual Studio 2017\Visualizers").

![](https://github.com/Tencent/ncnn/blob/master/tools/plugin/snapshot.png)

See [Image Watch Help](https://imagewatch.azurewebsites.net/ImageWatchHelp/ImageWatchHelp.htm) page for more advanced using tips of Image Watch(For example, get single channel from channels, such as getting confidence heatmap from forward result list {confidence, x1, y1, x2, y2}).

BIN
tools/plugin/snapshot.png View File

Before After
Width: 718  |  Height: 477  |  Size: 318 kB

Loading…
Cancel
Save