Skip to content
Permalink
Browse files

Add a Visual Studio solution file. (#615)

* Fix issues in download progress.

* Create a Visual Studio solution.

* Remove the startup file. You could right click a Python file and start debugging.
  • Loading branch information...
linmajia authored and rainLiuplus committed Mar 12, 2019
1 parent 6e0b561 commit 70fb819532e4f7633c1a02bedf35a7c134117d69
Showing with 327 additions and 4 deletions.
  1. +7 −0 .gitignore
  2. +279 −0 mmdnn.pyproj
  3. +23 −0 mmdnn.sln
  4. +18 −4 mmdnn/conversion/common/utils.py
@@ -105,3 +105,10 @@ node_modules/
package-lock.json
*.log
.vscode/

# tests temporary files
tests/cache/
tests/tmp/

# Visual Studio
.vs/
@@ -0,0 +1,279 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{f52d66f2-ff19-4700-bcaf-734e1a2fb037}</ProjectGuid>
<ProjectHome />
<StartupFile></StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="docs\client.py" />
<Compile Include="mmdnn\conversion\caffe\caffe_emitter.py" />
<Compile Include="mmdnn\conversion\caffe\caffe_pb2.py" />
<Compile Include="mmdnn\conversion\caffe\common_graph.py" />
<Compile Include="mmdnn\conversion\caffe\errors.py" />
<Compile Include="mmdnn\conversion\caffe\graph.py" />
<Compile Include="mmdnn\conversion\caffe\mapper.py" />
<Compile Include="mmdnn\conversion\caffe\network.py" />
<Compile Include="mmdnn\conversion\caffe\resolver.py" />
<Compile Include="mmdnn\conversion\caffe\saver.py" />
<Compile Include="mmdnn\conversion\caffe\shape.py" />
<Compile Include="mmdnn\conversion\caffe\transformer.py" />
<Compile Include="mmdnn\conversion\caffe\utils.py" />
<Compile Include="mmdnn\conversion\caffe\writer.py" />
<Compile Include="mmdnn\conversion\caffe\__init__.py" />
<Compile Include="mmdnn\conversion\cntk\cntk_emitter.py" />
<Compile Include="mmdnn\conversion\cntk\cntk_graph.py" />
<Compile Include="mmdnn\conversion\cntk\cntk_parser.py" />
<Compile Include="mmdnn\conversion\cntk\saver.py" />
<Compile Include="mmdnn\conversion\cntk\__init__.py" />
<Compile Include="mmdnn\conversion\common\DataStructure\emitter.py" />
<Compile Include="mmdnn\conversion\common\DataStructure\graph.py" />
<Compile Include="mmdnn\conversion\common\DataStructure\parser.py" />
<Compile Include="mmdnn\conversion\common\DataStructure\__init__.py" />
<Compile Include="mmdnn\conversion\common\IR\graph_pb2.py" />
<Compile Include="mmdnn\conversion\common\IR\IR_graph.py" />
<Compile Include="mmdnn\conversion\common\IR\__init__.py" />
<Compile Include="mmdnn\conversion\common\utils.py" />
<Compile Include="mmdnn\conversion\common\__init__.py" />
<Compile Include="mmdnn\conversion\coreml\coreml_emitter.py" />
<Compile Include="mmdnn\conversion\coreml\coreml_graph.py" />
<Compile Include="mmdnn\conversion\coreml\coreml_parser.py" />
<Compile Include="mmdnn\conversion\coreml\coreml_utils.py" />
<Compile Include="mmdnn\conversion\coreml\__init__.py" />
<Compile Include="mmdnn\conversion\darknet\cfg.py" />
<Compile Include="mmdnn\conversion\darknet\darknet_graph.py" />
<Compile Include="mmdnn\conversion\darknet\darknet_parser.py" />
<Compile Include="mmdnn\conversion\darknet\darknet_utils.py" />
<Compile Include="mmdnn\conversion\darknet\prototxt.py" />
<Compile Include="mmdnn\conversion\darknet\__init__.py" />
<Compile Include="mmdnn\conversion\examples\caffe\extractor.py" />
<Compile Include="mmdnn\conversion\examples\caffe\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\caffe\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\caffe\__init__.py" />
<Compile Include="mmdnn\conversion\examples\cntk\extractor.py" />
<Compile Include="mmdnn\conversion\examples\cntk\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\cntk\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\cntk\__init__.py" />
<Compile Include="mmdnn\conversion\examples\coreml\extractor.py" />
<Compile Include="mmdnn\conversion\examples\coreml\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\coreml\test_tfcoreml.py" />
<Compile Include="mmdnn\conversion\examples\coreml\__init__.py" />
<Compile Include="mmdnn\conversion\examples\darknet\darknet.py" />
<Compile Include="mmdnn\conversion\examples\darknet\extractor.py" />
<Compile Include="mmdnn\conversion\examples\darknet\__init__.py" />
<Compile Include="mmdnn\conversion\examples\extractor.py" />
<Compile Include="mmdnn\conversion\examples\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\keras\extractor.py" />
<Compile Include="mmdnn\conversion\examples\keras\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\keras\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\keras\utils.py" />
<Compile Include="mmdnn\conversion\examples\keras\__init__.py" />
<Compile Include="mmdnn\conversion\examples\mxnet\extractor.py" />
<Compile Include="mmdnn\conversion\examples\mxnet\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\mxnet\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\mxnet\__init__.py" />
<Compile Include="mmdnn\conversion\examples\onnx\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\onnx\__init__.py" />
<Compile Include="mmdnn\conversion\examples\paddle\extractor.py" />
<Compile Include="mmdnn\conversion\examples\paddle\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\paddle\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\paddle\models\alexnet.py" />
<Compile Include="mmdnn\conversion\examples\paddle\models\resnet.py" />
<Compile Include="mmdnn\conversion\examples\paddle\models\vgg.py" />
<Compile Include="mmdnn\conversion\examples\paddle\models\__init__.py" />
<Compile Include="mmdnn\conversion\examples\paddle\__init__.py" />
<Compile Include="mmdnn\conversion\examples\pytorch\extractor.py" />
<Compile Include="mmdnn\conversion\examples\pytorch\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\pytorch\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\pytorch\__init__.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\extractor.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\extract_model.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\imagenet_test.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\inception_resnet_v1.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\inception_resnet_v2.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\mobilenet\conv_blocks.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\mobilenet\mobilenet.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\mobilenet\mobilenet_v2.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\mobilenet\__init__.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\mobilenet_v1.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\nasnet.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\nasnet_utils.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\test_rnn.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\models\__init__.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\vis_meta.py" />
<Compile Include="mmdnn\conversion\examples\tensorflow\__init__.py" />
<Compile Include="mmdnn\conversion\examples\__init__.py" />
<Compile Include="mmdnn\conversion\keras\extra_layers.py" />
<Compile Include="mmdnn\conversion\keras\keras2_emitter.py" />
<Compile Include="mmdnn\conversion\keras\keras2_graph.py" />
<Compile Include="mmdnn\conversion\keras\keras2_parser.py" />
<Compile Include="mmdnn\conversion\keras\saver.py" />
<Compile Include="mmdnn\conversion\keras\__init__.py" />
<Compile Include="mmdnn\conversion\mxnet\mxnet_emitter.py" />
<Compile Include="mmdnn\conversion\mxnet\mxnet_graph.py" />
<Compile Include="mmdnn\conversion\mxnet\mxnet_parser.py" />
<Compile Include="mmdnn\conversion\mxnet\saver.py" />
<Compile Include="mmdnn\conversion\mxnet\__init__.py" />
<Compile Include="mmdnn\conversion\onnx\onnx_emitter.py" />
<Compile Include="mmdnn\conversion\onnx\onnx_graph.py" />
<Compile Include="mmdnn\conversion\onnx\onnx_parser.py" />
<Compile Include="mmdnn\conversion\onnx\saver.py" />
<Compile Include="mmdnn\conversion\onnx\shape_inference.py" />
<Compile Include="mmdnn\conversion\onnx\__init__.py" />
<Compile Include="mmdnn\conversion\paddle\paddle_graph.py" />
<Compile Include="mmdnn\conversion\paddle\paddle_parser.py" />
<Compile Include="mmdnn\conversion\paddle\__init__.py" />
<Compile Include="mmdnn\conversion\pytorch\pytorch_emitter.py" />
<Compile Include="mmdnn\conversion\pytorch\pytorch_graph.py" />
<Compile Include="mmdnn\conversion\pytorch\pytorch_parser.py" />
<Compile Include="mmdnn\conversion\pytorch\saver.py" />
<Compile Include="mmdnn\conversion\pytorch\torch_to_np.py" />
<Compile Include="mmdnn\conversion\pytorch\__init__.py" />
<Compile Include="mmdnn\conversion\rewriter\folder.py" />
<Compile Include="mmdnn\conversion\rewriter\graph_matcher.py" />
<Compile Include="mmdnn\conversion\rewriter\rewriter.py" />
<Compile Include="mmdnn\conversion\rewriter\rnn_utils.py" />
<Compile Include="mmdnn\conversion\rewriter\utils.py" />
<Compile Include="mmdnn\conversion\rewriter\__init__.py" />
<Compile Include="mmdnn\conversion\tensorflow\rewriter\gru_rewriter.py" />
<Compile Include="mmdnn\conversion\tensorflow\rewriter\lstm_rewriter.py" />
<Compile Include="mmdnn\conversion\tensorflow\rewriter\__init__.py" />
<Compile Include="mmdnn\conversion\tensorflow\saver.py" />
<Compile Include="mmdnn\conversion\tensorflow\tensorflow_emitter.py" />
<Compile Include="mmdnn\conversion\tensorflow\tensorflow_frozenparser.py" />
<Compile Include="mmdnn\conversion\tensorflow\tensorflow_graph.py" />
<Compile Include="mmdnn\conversion\tensorflow\tensorflow_parser.py" />
<Compile Include="mmdnn\conversion\tensorflow\__init__.py" />
<Compile Include="mmdnn\conversion\torch\torch_graph.py" />
<Compile Include="mmdnn\conversion\torch\torch_parser.py" />
<Compile Include="mmdnn\conversion\torch\__init__.py" />
<Compile Include="mmdnn\conversion\_script\convert.py" />
<Compile Include="mmdnn\conversion\_script\convertToIR.py" />
<Compile Include="mmdnn\conversion\_script\dump_code.py" />
<Compile Include="mmdnn\conversion\_script\extractModel.py" />
<Compile Include="mmdnn\conversion\_script\IRToCode.py" />
<Compile Include="mmdnn\conversion\_script\IRToModel.py" />
<Compile Include="mmdnn\conversion\_script\__init__.py" />
<Compile Include="mmdnn\conversion\__init__.py" />
<Compile Include="mmdnn\models\GenerateMdByDataset.py" />
<Compile Include="mmdnn\models\GenerateMdFromJson.py" />
<Compile Include="mmdnn\__init__.py" />
<Compile Include="requirements\select_requirements.py" />
<Compile Include="setup.py" />
<Compile Include="tests\conversion_imagenet.py" />
<Compile Include="tests\gen_test.py" />
<Compile Include="tests\test_caffe.py" />
<Compile Include="tests\test_caffe_2.py" />
<Compile Include="tests\test_cntk.py" />
<Compile Include="tests\test_coreml.py" />
<Compile Include="tests\test_darknet.py" />
<Compile Include="tests\test_keras.py" />
<Compile Include="tests\test_keras_2.py" />
<Compile Include="tests\test_keras_3.py" />
<Compile Include="tests\test_mxnet.py" />
<Compile Include="tests\test_mxnet_2.py" />
<Compile Include="tests\test_paddle.py" />
<Compile Include="tests\test_pytorch.py" />
<Compile Include="tests\test_pytorch_2.py" />
<Compile Include="tests\test_tensorflow.py" />
<Compile Include="tests\test_tensorflow_2.py" />
<Compile Include="tests\test_tensorflow_frozen.py" />
<Compile Include="tests\utils.py" />
</ItemGroup>
<ItemGroup>
<Content Include=".gitattributes" />
<Content Include=".gitignore" />
<Content Include=".travis.yml" />
<Content Include="docs\cntk2keras.jpg" />
<Content Include="docs\darkent_keras_yolov3_converted.jpg" />
<Content Include="docs\Poster-MMdnn.jpg" />
<Content Include="docs\supported.jpg" />
<Content Include="docs\tensorboard.png" />
<Content Include="docs\vismmdnn.png" />
<Content Include="ISSUE_TEMPLATE.md" />
<Content Include="LICENSE" />
<Content Include="mmdnn\conversion\examples\data\dog.jpg" />
<Content Include="mmdnn\conversion\examples\data\imagenet_1000.txt" />
<Content Include="mmdnn\conversion\examples\data\seagull.jpg" />
<Content Include="mmdnn\conversion\onnx\elephant.jpg" />
<Content Include="mmdnn\visualization\app.js" />
<Content Include="mmdnn\visualization\draw.js" />
<Content Include="mmdnn\visualization\index.html" />
<Content Include="mmdnn\visualization\public\draw.js" />
<Content Include="mmdnn\visualization\public\style.css" />
<Content Include="mmdnn\visualization\style.css" />
<Content Include="mmdnn\vis_edit\public\favicon.ico" />
<Content Include="mmdnn\vis_edit\public\index.html" />
<Content Include="mmdnn\vis_edit\src\components\App.css" />
<Content Include="mmdnn\vis_edit\src\components\Graph.css" />
<Content Include="mmdnn\vis_edit\src\components\SideBar.css" />
<Content Include="mmdnn\vis_edit\src\index.css" />
<Content Include="mmdnn\vis_edit\src\logo.svg" />
<Content Include="README.md" />
<Content Include="requirements\linux-py2.txt" />
<Content Include="requirements\linux-py3.txt" />
<Content Include="setup.cfg" />
<Content Include="test.sh" />
<Content Include="_config.yml" />
</ItemGroup>
<ItemGroup>
<Folder Include="docs" />
<Folder Include="mmdnn" />
<Folder Include="mmdnn\conversion" />
<Folder Include="mmdnn\conversion\caffe" />
<Folder Include="mmdnn\conversion\cntk" />
<Folder Include="mmdnn\conversion\common" />
<Folder Include="mmdnn\conversion\common\DataStructure" />
<Folder Include="mmdnn\conversion\common\IR" />
<Folder Include="mmdnn\conversion\coreml" />
<Folder Include="mmdnn\conversion\darknet" />
<Folder Include="mmdnn\conversion\examples" />
<Folder Include="mmdnn\conversion\examples\caffe" />
<Folder Include="mmdnn\conversion\examples\cntk" />
<Folder Include="mmdnn\conversion\examples\coreml" />
<Folder Include="mmdnn\conversion\examples\darknet" />
<Folder Include="mmdnn\conversion\examples\data" />
<Folder Include="mmdnn\conversion\examples\keras" />
<Folder Include="mmdnn\conversion\examples\mxnet" />
<Folder Include="mmdnn\conversion\examples\onnx" />
<Folder Include="mmdnn\conversion\examples\paddle" />
<Folder Include="mmdnn\conversion\examples\paddle\models" />
<Folder Include="mmdnn\conversion\examples\pytorch" />
<Folder Include="mmdnn\conversion\examples\tensorflow" />
<Folder Include="mmdnn\conversion\examples\tensorflow\models" />
<Folder Include="mmdnn\conversion\examples\tensorflow\models\mobilenet" />
<Folder Include="mmdnn\conversion\keras" />
<Folder Include="mmdnn\conversion\mxnet" />
<Folder Include="mmdnn\conversion\onnx" />
<Folder Include="mmdnn\conversion\paddle" />
<Folder Include="mmdnn\conversion\pytorch" />
<Folder Include="mmdnn\conversion\rewriter" />
<Folder Include="mmdnn\conversion\tensorflow" />
<Folder Include="mmdnn\conversion\tensorflow\rewriter" />
<Folder Include="mmdnn\conversion\torch" />
<Folder Include="mmdnn\conversion\_script" />
<Folder Include="mmdnn\models" />
<Folder Include="mmdnn\visualization" />
<Folder Include="mmdnn\visualization\public" />
<Folder Include="mmdnn\vis_edit\" />
<Folder Include="mmdnn\vis_edit\public" />
<Folder Include="mmdnn\vis_edit\src" />
<Folder Include="mmdnn\vis_edit\src\components" />
<Folder Include="requirements" />
<Folder Include="tests" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
</Project>
@@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.438
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "mmdnn", "mmdnn.pyproj", "{F52D66F2-FF19-4700-BCAF-734E1A2FB037}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F52D66F2-FF19-4700-BCAF-734E1A2FB037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F52D66F2-FF19-4700-BCAF-734E1A2FB037}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F8D6A99B-00AE-4CC9-B68E-B5036A386C58}
EndGlobalSection
EndGlobal
@@ -126,11 +126,25 @@ def compute_tf_same_padding(input_shape, kernel_shape, strides, data_format='NHW


# network library
def sizeof_fmt(num, suffix='B'):
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f %s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f %s%s" % (num, 'Yi', suffix)


def _progress_check(count, block_size, total_size):
progress_size = int(count * block_size) / 1024
percent = int(count * block_size * 100 / total_size)
percent = min(percent, 100)
sys.stdout.write("\rprogress: {} KB downloaded, {}%".format(progress_size, percent))
read_size = count * block_size
read_size_str = sizeof_fmt(read_size)
if total_size > 0:
percent = int(count * block_size * 100 / total_size)
percent = min(percent, 100)
sys.stdout.write("\rprogress: {} downloaded, {}%.".format(read_size_str, percent))
if read_size >= total_size:
sys.stderr.write("\n")
else:
sys.stdout.write("\rprogress: {} downloaded.".format(read_size_str))
sys.stdout.flush()


0 comments on commit 70fb819

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.