Skip to content

Commit e38c5a6

Browse files
kalcoholnihui
authored andcommitted
Request add ncnn::Mat support for Visual Studio Image Watch Tools (Tencent#625)
* add image watch plugin for image watch tools of visual studio * add a new blank line as the end line
1 parent 0139939 commit e38c5a6

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

tools/plugin/ImageWatchNCNN.natvis

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
3+
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>
4+
5+
<!-- Tencent NCNN ncnn::Mat support -->
6+
7+
<Type Name="ncnn::Mat">
8+
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
9+
</Type>
10+
11+
<Type Name="ncnn::Mat">
12+
<DisplayString Condition="elemsize==4">{{FLOAT32, {c} x {w} x {h}}}</DisplayString>
13+
<DisplayString Condition="elemsize==2">{{FLOAT16, {c} x {w} x {h}}}</DisplayString>
14+
<DisplayString Condition="elemsize==1">{{INT8, {c} x {w} x {h}}}</DisplayString>
15+
<Expand>
16+
<Synthetic Name="[type]" Condition="elemsize==4">
17+
<DisplayString>FLOAT32</DisplayString>
18+
</Synthetic>
19+
<Synthetic Name="[type]" Condition="elemsize==2">
20+
<DisplayString>FLOAT16</DisplayString>
21+
</Synthetic>
22+
<Synthetic Name="[type]" Condition="elemsize==1">
23+
<DisplayString>INT8</DisplayString>
24+
</Synthetic>
25+
<Item Name="[channels]">c</Item>
26+
<Item Name="[width]">w</Item>
27+
<Item Name="[height]">h</Item>
28+
<Item Name="[planes]">c</Item>
29+
<Item Name="[data]" Condition="elemsize==4">((float*)(data))</Item>
30+
<Item Name="[data]" Condition="elemsize==2">data</Item>
31+
<Item Name="[data]" Condition="elemsize==1">data</Item>
32+
<Item Name="[stride]" Condition="elemsize==1">w</Item>
33+
<Item Name="[stride]" Condition="elemsize==2">w*2</Item>
34+
<Item Name="[stride]" Condition="elemsize==4">w*4</Item>
35+
</Expand>
36+
</Type>
37+
</AutoVisualizer>

tools/plugin/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
## NCNN Image Watch Plugin for Visual Studio
3+
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.
4+
5+
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").
6+
7+
![](https://github.com/Tencent/ncnn/blob/master/tools/plugin/snapshot.png)
8+
9+
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}).

tools/plugin/snapshot.png

310 KB
Loading

0 commit comments

Comments
 (0)