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 Dec 13, 2023
2 parents 91f59e6 + a7ac66f commit 0ef1341
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 43 deletions.
21 changes: 1 addition & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ FIND_PACKAGE(CSharp REQUIRED)
MESSAGE(STATUS "DOTNET_FOUND: ${DOTNET_FOUND}")
INCLUDE (CheckPlatform)
IF ( (IS_UBUNTU OR IS_DEBIAN) AND NOT (DOTNET_FOUND))
MESSAGE(FATAL_ERROR "dotnet is required to build Emgu TF, please follow the instructions to install dotnet: https://dotnet.microsoft.com/download/dotnet/6.0")
MESSAGE(FATAL_ERROR "dotnet is required to build Emgu TF, please follow the instructions to install dotnet: https://dotnet.microsoft.com/download/dotnet")
ENDIF()
#MESSAGE(STATUS "IS_UBUNTU: ${IS_UBUNTU}")
INCLUDE (CSharpMacros)
Expand All @@ -75,11 +75,8 @@ MACRO(CHECK_LICENSE_TYPE)
STRING(STRIP "${TMP}" TMP)
STRING(LENGTH "${TMP}" GPL_LICENSE_LENGTH)
SET (LICENSE_TYPE "Dual License")
#SET (EMGUTF_LICENSE_FILE ${LICENSE_FILE_NAME})
#SET (EMGUTF_LICENSE_URL "https://www.gnu.org/licenses/gpl-3.0.txt")
IF(${GPL_LICENSE_LENGTH} EQUAL 0)
SET(LICENSE_TYPE "Commercial")
# SET (EMGUTF_LICENSE_URL "https://www.emgu.com/wiki/files/Emgu.TF.Commercial.License.1.0.pdf")
ENDIF()

MESSAGE(STATUS "LICENSE_TYPE: ${LICENSE_TYPE}")
Expand Down Expand Up @@ -134,7 +131,6 @@ IF (WIN32)
IF(TARGET_ARCH_64)
SET(EMGUTF_ARCH win64)
ELSE()
#ELSEIF ( ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") )
MESSAGE(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
STRING(FIND "${CMAKE_GENERATOR}" "ARM" IS_ARM)
IF(IS_ARM GREATER -1)
Expand Down Expand Up @@ -317,26 +313,11 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow/bazel-bin/external/XNNPACK)
SET(WINDESKTOP_LITE_LABEL "${WINDESKTOP_LITE_LABEL}_xnn")
ENDIF()



#IF (HAVE_WINDESKTOP_X86_LITE AND HAVE_WINDESKTOP_X64_LITE)
#
#ENDIF()

#IF(HAVE_WINDESKTOP_X64_LITE)
#ENDIF()

SET(WINDOWS_LABEL "${WINDESKTOP_LABEL}")
IF ("${WINDOWS_LABEL}" STREQUAL "-UWP-windesktop")
SET(WINDOWS_LABEL "-windows")
ENDIF()

#SET(IOS_LABEL "")
#IF(HAVE_IOS)
# #MESSAGE(STATUS "HAVE_IOS: ${HAVE_IOS}")
# SET(IOS_LABEL "-ios")
#ENDIF()

SET(IOS_LITE_LABEL "")
IF(HAVE_IOS_LITE)
#MESSAGE(STATUS "HAVE_IOS_LITE: ${HAVE_IOS_LITE}")
Expand Down
2 changes: 1 addition & 1 deletion Emgu.TF.Example/Inception.Console.NetCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Program

static async Task Main(string[] args)
{
System.Console.WriteLine("Starting...");
System.Console.WriteLine(String.Format("Starting Emgu TF v{0}", TfInvoke.Version));
#if DEBUG
ConsoleTraceListener consoleTraceListener = new ConsoleTraceListener();
Trace.Listeners.Add(consoleTraceListener);
Expand Down
32 changes: 15 additions & 17 deletions Emgu.TF.Protobuf/Emgu.TF.Protobuf.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
<Import_RootNamespace>Emgu.TF.Protobuf</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>

<Compile Include="$(MSBuildThisFileDirectory)*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Core/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Core/Platform/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/Model/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/Experimental/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Dummy/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Eager/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Error/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Error/Dummy/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Tpu/*.cs" />
<!-- <Compile Include="$(MSBuildThisFileDirectory)/Xla/*.cs" /> -->
<Compile Include="$(MSBuildThisFileDirectory)/StreamExecutor/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/StreamExecutor/Dnn/*.cs" />

<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Core/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Core/Platform/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/Model/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Data/Experimental/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Dummy/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Eager/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Error/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Error/Dummy/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Tensorflow/Tpu/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/Xla/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/StreamExecutor/*.cs" />
<Compile Include="$(MSBuildThisFileDirectory)/StreamExecutor/Dnn/*.cs" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion platforms/android/build_tf_android
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set -x
bazel --output_user_root=$OUTPUT_USER_ROOT \
build -c opt \
--config=android_$1 \
--action_env ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/21.4.7075529 \
--action_env ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/25.2.9519653 \
--action_env ANDROID_NDK_API_LEVEL=28 \
--action_env ANDROID_SDK_API_LEVEL=23 \
--action_env ANDROID_SDK_HOME=/usr/lib/android-sdk \
Expand Down
10 changes: 7 additions & 3 deletions platforms/android/build_tflite_android
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/bin/bash

extra_flags=
if [ \( -n "$1" \) ]; then
if [ "$1" = "x86" ]; then
arch="x86"
elif [ "$1" = "x86_64" ]; then
arch="x86_64"
elif [ "$1" = "arm" ]; then
arch="armeabi-v7a"
extra_flags="--define=xnn_enable_arm_i8mm=false"
elif [ "$1" = "arm64" ]; then
arch="arm64-v8a"
extra_flags="--define=xnn_enable_arm_i8mm=false"
fi
echo "Building with config android_$1 for $arch architecture"
else
Expand All @@ -24,13 +27,14 @@ set -x
bazel --output_user_root=$OUTPUT_USER_ROOT \
build -c opt \
--config=android_$1\
--action_env ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/25.2.9519653 \
--action_env ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/21.4.7075529 \
--action_env ANDROID_NDK_API_LEVEL=28 \
--action_env ANDROID_SDK_API_LEVEL=23 \
--action_env ANDROID_SDK_HOME=/usr/lib/android-sdk \
--verbose_failures \
--verbose_failures $extra_flags\
//tensorflow/tfliteextern:libtfliteextern.so


#--action_env ANDROID_NDK_HOME=/usr/lib/android-sdk/ndk/25.2.9519653 \
#--action_env ANDROID_BUILD_TOOLS_VERSION=debian \

set +x
Expand Down
2 changes: 1 addition & 1 deletion platforms/windows/bazel_build_tf.bat
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ REM Only use VS2017 in GPU build: CUDA 10.0 only support up to VS2017
REM IF "%2%" == "gpu" GOTO SET_BAZEL_VS_VC
IF EXIST "%VS2019%" SET DEVENV=%VS2019%

IF EXIST "%VS2022%" SET DEVENV=%VS2022%
REM IF EXIST "%VS2022%" SET DEVENV=%VS2022%

IF EXIST "%BUILD_TOOLS_FOLDER%" SET DEVENV=%BUILD_TOOLS_FOLDER%

Expand Down

0 comments on commit 0ef1341

Please sign in to comment.