Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/emgucv/emgutf
Browse files Browse the repository at this point in the history
  • Loading branch information
Canming Huang committed Jul 8, 2021
2 parents dd63134 + b78b46e commit 5e86593
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 36 deletions.
1 change: 1 addition & 0 deletions Emgu.TF.Lite.Unity/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"com.unity.test-framework": "1.1.26",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.21-preview",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.7",
"com.unity.modules.ai": "1.0.0",
Expand Down
Binary file modified Emgu.TF.Lite.Unity/ProjectSettings/ProjectSettings.asset
Binary file not shown.
6 changes: 6 additions & 0 deletions Emgu.TF.Lite.Unity/copy_unity_assets
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ cp ../Emgu.TF.Util/*.cs Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.TF.Util/
cp ../Emgu.TF.Lite/*.cs Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.TF.Lite/
cp ../Emgu.Models/*.cs Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.Models/
cp ../Emgu.TF.Lite.Models/*.cs Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.TF.Lite.Models/

cd Assets/Emgu.TF.Lite/Plugins
if test -d "../../../../platforms/macos/tfliteextern.bundle"
then
cp -rf ../../../../platforms/macos/tfliteextern.bundle ./
fi

This file was deleted.

1 change: 1 addition & 0 deletions Emgu.TF.Unity/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"com.unity.test-framework": "1.1.26",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.21-preview",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.7",
"com.unity.modules.ai": "1.0.0",
Expand Down
Binary file modified Emgu.TF.Unity/ProjectSettings/ProjectSettings.asset
Binary file not shown.
Binary file modified Emgu.TF.Unity/ProjectSettings/UnityConnectSettings.asset
Binary file not shown.
10 changes: 8 additions & 2 deletions Emgu.TF.Unity/copy_unity_assets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash -v
cd "$(dirname "$0")"

cd Assets
Expand All @@ -23,4 +23,10 @@ cp ../Emgu.TF.Util/*.cs Assets/Emgu.TF/Assets/Scripts/Emgu.TF.Util/
cp ../Emgu.TF/*.cs Assets/Emgu.TF/Assets/Scripts/Emgu.TF/
cp ../Emgu.TF.Models/*.cs Assets/Emgu.TF/Assets/Scripts/Emgu.TF.Models/
cp ../Emgu.Models/*.cs Assets/Emgu.TF/Assets/Scripts/Emgu.Models/
cp ./Assets/csc.rsp* Assets/Emgu.TF/Assets/
cp ./Assets/csc.rsp* Assets/Emgu.TF/Assets/

if test -d "../platforms/macos/tfextern.bundle"
then
cp -rf ../platforms/macos/tfextern.bundle Assets/Emgu.TF/Plugins/
fi

6 changes: 1 addition & 5 deletions Emgu.TF/TfInvokeEntryPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ public partial class TfInvoke
/// <summary>
/// The file name of the tfextern library
/// </summary>
#if UNITY_EDITOR_OSX
public const string ExternLibrary = "Assets/Emgu.TF/Plugins/emgutf.bundle/Contents/MacOS/libtfextern.dylib";
#elif UNITY_STANDALONE_OSX
public const string ExternLibrary = "@executable_path/../Plugins/emgutf.bundle/Contents/MacOS/libtfextern.dylib";
#elif (__IOS__ || UNITY_IPHONE) && (!UNITY_EDITOR)
#if (__IOS__ || UNITY_IPHONE) && (!UNITY_EDITOR)
public const string ExternLibrary = "__Internal";
#else
public const string ExternLibrary = "tfextern";
Expand Down
4 changes: 3 additions & 1 deletion platforms/macos/Info.lite.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<key>CFBundleIdentifier</key>
<string>com.emgu.tf.lite</string>
<key>CFBundleName</key>
<string>EmguTFLite</string>
<string>tfliteextern</string>
<key>CFBundleIconFile</key>
<string>icons.icns</string>
<key>CFBundleExecutable</key>
<string>libtfliteextern.dylib</string>
<key>CFBundleShortVersionString</key>
<string>0.01</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
4 changes: 3 additions & 1 deletion platforms/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<key>CFBundleIdentifier</key>
<string>com.emgu.tf</string>
<key>CFBundleName</key>
<string>EmguTF</string>
<string>tfextern</string>
<key>CFBundleIconFile</key>
<string>icons.icns</string>
<key>CFBundleExecutable</key>
<string>libtfextern.dylib</string>
<key>CFBundleShortVersionString</key>
<string>0.01</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
7 changes: 6 additions & 1 deletion platforms/macos/bazel_build_tflite_macos
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

if [[ $# -lt 1 ]]; then
BAZEL_CPU=darwin
else
BAZEL_CPU=$1
fi
cd "$(dirname "$0")"
cd ../../
mkdir -p lib/macos
cd tensorflow
bazel build --verbose_failures -c opt --cpu=darwin --cxxopt='--std=c++11' //tensorflow/tfliteextern:libtfliteextern.so
bazel build --verbose_failures -c opt --cpu=$BAZEL_CPU --cxxopt='--std=c++11' //tensorflow/tfliteextern:libtfliteextern.so
cp -f bazel-bin/tensorflow/tfliteextern/libtfliteextern.so ../lib/macos/libtfliteextern.dylib
#cp -f bazel-bin/tensorflow/tfliteextern/libtfliteextern.so ../platforms/osx/darwin_x86_64/libtfliteextern.dylib

Expand Down
23 changes: 14 additions & 9 deletions platforms/macos/makeBundle
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/usr/bin/env bash

rm -rf emgutf.bundle
mkdir emgutf.bundle
mkdir emgutf.bundle/Contents
mkdir emgutf.bundle/Contents/MacOS
mkdir emgutf.bundle/Contents/Resources
cp ../../lib/macos/libtfextern.dylib emgutf.bundle/Contents/MacOS/
cp ../../lib/macos/libtensorflow_framework.dylib emgutf.bundle/Contents/MacOS/
cp Info.plist emgutf.bundle/Contents/
rm -rf tfextern.bundle
mkdir -p tfextern.bundle/Contents/MacOS
mkdir -p tfextern.bundle/Contents/Resources
mkdir -p tfextern.bundle/Contents/Frameworks

cp ../../lib/macos/libtfextern.dylib tfextern.bundle/Contents/MacOS/
install_name_tool -change "@rpath/libtensorflow_framework.dylib" "@loader_path/../Frameworks/libtensorflow_framework.dylib" tfextern.bundle/Contents/MacOS/libtfextern.dylib
chmod u+w tfextern.bundle/Contents/MacOS/libtfextern.dylib

cp ../../lib/macos/libtensorflow_framework.dylib tfextern.bundle/Contents/Frameworks/
chmod u+w tfextern.bundle/Contents/Frameworks/libtensorflow_framework.dylib

cp Info.plist tfextern.bundle/Contents/
iconutil -c icns icons.iconset/
cp icons.icns emgutf.bundle/Contents/Resources/
cp icons.icns tfextern.bundle/Contents/Resources/
17 changes: 9 additions & 8 deletions platforms/macos/makeBundleLite
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env bash

rm -rf emgutflite.bundle
mkdir emgutflite.bundle
mkdir emgutflite.bundle/Contents
mkdir emgutflite.bundle/Contents/MacOS
mkdir emgutflite.bundle/Contents/Resources
cp ../../lib/macos/libtfliteextern.dylib emgutflite.bundle/Contents/MacOS/
cp Info.lite.plist emgutflite.bundle/Contents/Info.plist
rm -rf tfliteextern.bundle
mkdir -p tfliteextern.bundle/Contents/MacOS
mkdir -p tfliteextern.bundle/Contents/Resources

cp ../../lib/macos/libtfliteextern.dylib tfliteextern.bundle/Contents/MacOS/
chmod u+w tfliteextern.bundle/Contents/MacOS/libtfliteextern.dylib

cp Info.lite.plist tfliteextern.bundle/Contents/Info.plist
iconutil -c icns icons.iconset/
cp icons.icns emgutflite.bundle/Contents/Resources/
cp icons.icns tfliteextern.bundle/Contents/Resources/

0 comments on commit 5e86593

Please sign in to comment.