Skip to content

Commit

Permalink
Fix builds for TensorFlow Lite and DepthAI
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Dec 5, 2023
1 parent 6ba63f1 commit 8601018
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion depthai/src/gen/java/org/bytedeco/depthai/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Camera extends CameraPropertiesNode {
/**
* Computes the scaled size given numerator and denominator
*/
public static native int getScaledSize(int input, int num, int denom);


/**
* Initial control options to apply to sensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ public void map(InfoMap infoMap) {
.put(new Info("dai::DeviceBase::Config", "dai::Device::Config").pointerTypes("DeviceBase.Config"))
.put(new Info("auto", "span", "std::initializer_list", "std::weak_ptr", "dai::XLinkStream(dai::XLinkStream)",
"dai::RawStereoDepthConfig::CostAggregation::defaultHorizontalPenaltyCosts",
"dai::RawStereoDepthConfig::CostAggregation::defaultVerticalPenaltyCosts").skip())
"dai::RawStereoDepthConfig::CostAggregation::defaultVerticalPenaltyCosts",
"dai::node::Camera::getScaledSize").skip())
.put(new Info("std::chrono::microseconds", "std::chrono::milliseconds", "std::chrono::seconds", "std::runtime_error",
"std::chrono::duration<Rep,Period>", "std::chrono::duration<dai::ImgFrame,Period>",
"std::chrono::time_point<std::chrono::steady_clock,std::chrono::steady_clock::duration>",
Expand Down
6 changes: 3 additions & 3 deletions tensorflow-lite/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ case $PLATFORM in
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=24 $CMAKE_FLAGS"
;;
android-arm64)
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=24 $CMAKE_FLAGS"
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=24 -DXNNPACK_ENABLE_ARM_I8MM=OFF $CMAKE_FLAGS"
;;
android-x86)
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86 -DANDROID_NATIVE_API_LEVEL=24 $CMAKE_FLAGS"
Expand Down Expand Up @@ -73,8 +73,8 @@ case $PLATFORM in
windows-x86_64)
sedinplace 's/CMAKE_CXX_STANDARD 14/CMAKE_CXX_STANDARD 20/g' ../tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/CMakeLists.txt
sedinplace 's/__PRETTY_FUNCTION__/__func__/g' ../tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/kernels/internal/optimized/depthwiseconv*.h ../tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv.h
export CC="cl.exe -D_USE_MATH_DEFINES"
export CXX="cl.exe -D_USE_MATH_DEFINES"
export CC="cl.exe -D_USE_MATH_DEFINES -DTFLITE_MMAP_DISABLED"
export CXX="cl.exe -D_USE_MATH_DEFINES -DTFLITE_MMAP_DISABLED"
export CMAKE_FLAGS="-G Ninja $CMAKE_FLAGS"
# create a dummy m.lib to satisfy some dependencies somewhere
touch m.c
Expand Down

0 comments on commit 8601018

Please sign in to comment.