Skip to content

Commit

Permalink
* Upgrade presets for FFmpeg 7.0.2, TensorFlow Lite 2.17.0, Triton I…
Browse files Browse the repository at this point in the history
…nference Server 2.48.0
  • Loading branch information
saudet committed Aug 12, 2024
1 parent a11e6ce commit 40fdd78
Show file tree
Hide file tree
Showing 50 changed files with 680 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tritonserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ env:
jobs:
linux-x86_64:
runs-on: ubuntu-20.04
container: nvcr.io/nvidia/tritonserver:24.03-py3
container: nvcr.io/nvidia/tritonserver:24.07-py3
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481))
* Enable PulseAudio support for FFmpeg on Linux ([pull #1472](https://github.com/bytedeco/javacpp-presets/pull/1472))
* Virtualize `btCollisionWorld`, `btOverlapFilterCallback`, `btOverlapCallback` from Bullet Physics SDK ([pull #1475](https://github.com/bytedeco/javacpp-presets/pull/1475))
* Upgrade presets for OpenCV 4.10.0, FFmpeg 7.0, Spinnaker 4.0.0.116 ([pull #1524](https://github.com/bytedeco/javacpp-presets/pull/1524)), DNNL 3.5.3, OpenBLAS 0.3.28, CMINPACK 1.3.9, GSL 2.8, CPython 3.12.5, NumPy 2.0.1, SciPy 1.14.0, LLVM 18.1.8, LibRaw 0.21.2 ([pull #1520](https://github.com/bytedeco/javacpp-presets/pull/1520)), Tesseract 5.4.1, libffi 3.4.6, OpenCL 3.0.16, PyTorch 2.3.0 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), SentencePiece 0.2.0, TensorFlow Lite 2.16.1, TensorRT 10.0.1.6, Triton Inference Server 2.44.0, ONNX 1.16.2, ONNX Runtime 1.18.1, TVM 0.17.0, and their dependencies
* Upgrade presets for OpenCV 4.10.0, FFmpeg 7.0.2, Spinnaker 4.0.0.116 ([pull #1524](https://github.com/bytedeco/javacpp-presets/pull/1524)), DNNL 3.5.3, OpenBLAS 0.3.28, CMINPACK 1.3.9, GSL 2.8, CPython 3.12.5, NumPy 2.0.1, SciPy 1.14.0, LLVM 18.1.8, LibRaw 0.21.2 ([pull #1520](https://github.com/bytedeco/javacpp-presets/pull/1520)), Tesseract 5.4.1, libffi 3.4.6, OpenCL 3.0.16, PyTorch 2.3.0 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), SentencePiece 0.2.0, TensorFlow Lite 2.17.0, TensorRT 10.0.1.6, Triton Inference Server 2.48.0, ONNX 1.16.2, ONNX Runtime 1.18.1, TVM 0.17.0, and their dependencies

### January 29, 2024 version 1.5.10
* Introduce `macosx-arm64` builds for PyTorch ([pull #1463](https://github.com/bytedeco/javacpp-presets/pull/1463))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip
* PyTorch 2.3.x https://github.com/pytorch/pytorch
* SentencePiece 0.2.0 https://github.com/google/sentencepiece
* TensorFlow 1.15.x https://github.com/tensorflow/tensorflow
* TensorFlow Lite 2.16.x https://github.com/tensorflow/tensorflow
* TensorFlow Lite 2.17.x https://github.com/tensorflow/tensorflow
* TensorRT 10.0.x https://developer.nvidia.com/tensorrt
* Triton Inference Server 2.44.x https://developer.nvidia.com/nvidia-triton-inference-server
* Triton Inference Server 2.48.x https://developer.nvidia.com/nvidia-triton-inference-server
* The Arcade Learning Environment 0.8.x https://github.com/mgbellemare/Arcade-Learning-Environment
* DepthAI 2.24.x https://github.com/luxonis/depthai-core
* ONNX 1.16.x https://github.com/onnx/onnx
Expand Down
6 changes: 3 additions & 3 deletions ffmpeg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* FFmpeg 7.0 http://ffmpeg.org/
* FFmpeg 7.0.2 http://ffmpeg.org/

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand Down Expand Up @@ -46,14 +46,14 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>7.0-1.5.11-SNAPSHOT</version>
<version>7.0.2-1.5.11-SNAPSHOT</version>
</dependency>

<!-- Optional GPL builds with (almost) everything enabled -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>7.0-1.5.11-SNAPSHOT</version>
<version>7.0.2-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
14 changes: 7 additions & 7 deletions ffmpeg/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ SPEEX=speex-1.2.1
OPUS=opus-1.3.1
OPENCORE_AMR=opencore-amr-0.1.6
VO_AMRWBENC=vo-amrwbenc-0.1.3
OPENSSL=openssl-3.3.0
OPENSSL=openssl-3.3.1
OPENH264_VERSION=2.4.1
X264=x264-stable
X265=3.4
VPX_VERSION=1.14.0
ALSA_VERSION=1.2.11
VPX_VERSION=1.14.1
ALSA_VERSION=1.2.12
FREETYPE_VERSION=2.13.2
MFX_VERSION=1.35.1
NVCODEC_VERSION=12.2.72.0
XML2=libxml2-2.9.12
LIBSRT_VERSION=1.5.3
WEBP_VERSION=1.4.0
AOMAV1_VERSION=3.8.2
SVTAV1_VERSION=2.0.0
AOMAV1_VERSION=3.9.1
SVTAV1_VERSION=2.1.2
ZIMG_VERSION=3.0.5
FFMPEG_VERSION=7.0
FFMPEG_VERSION=7.0.2
download https://download.videolan.org/contrib/nasm/nasm-$NASM_VERSION.tar.gz nasm-$NASM_VERSION.tar.gz
download http://zlib.net/$ZLIB.tar.gz $ZLIB.tar.gz
download http://downloads.sourceforge.net/project/lame/lame/3.100/$LAME.tar.gz $LAME.tar.gz
Expand Down Expand Up @@ -123,7 +123,7 @@ patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-vulkan.patch
sedinplace 's/bool bEnableavx512/bool bEnableavx512 = false/g' x265-*/source/common/param.h
sedinplace 's/detect512()/false/g' x265-*/source/common/quant.cpp
sedinplace 's/CMAKE_C_COMPILER_ID MATCHES "Clang"/FALSE/g' SVT-AV1-*/CMakeLists.txt
sedinplace 's/defined(__linux__)/defined(__linux__) \&\& !defined(__ANDROID__)/g' SVT-AV1-*/Source/Lib/Common/Codec/EbThreads.h
# sedinplace 's/defined(__linux__)/defined(__linux__) \&\& !defined(__ANDROID__)/g' SVT-AV1-*/Source/Lib/Common/Codec/EbThreads.h
sedinplace '/ANativeWindow_release/d' ffmpeg-*/libavutil/hwcontext_mediacodec.c
sedinplace 's/#define MAX_SLICES 32/#define MAX_SLICES 256/g' ffmpeg-*/libavcodec/h264dec.h

Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/platform/gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>7.0-${project.parent.version}</version>
<version>7.0.2-${project.parent.version}</version>
<name>JavaCPP Presets Platform for FFmpeg (GPL enabled)</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>7.0-${project.parent.version}</version>
<version>7.0.2-${project.parent.version}</version>
<name>JavaCPP Presets Platform for FFmpeg</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg</artifactId>
<version>7.0-${project.parent.version}</version>
<version>7.0.2-${project.parent.version}</version>
<name>JavaCPP Presets for FFmpeg</name>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions ffmpeg/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>7.0-1.5.11-SNAPSHOT</version>
<version>7.0.2-1.5.11-SNAPSHOT</version>
</dependency>

<!-- Optional GPL builds with (almost) everything enabled -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>7.0-1.5.11-SNAPSHOT</version>
<version>7.0.2-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avutil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7657,7 +7657,7 @@ allocated with av_malloc() or another memory allocation function. */
/* Automatically generated by version.sh, do not manually edit! */
// #ifndef AVUTIL_FFVERSION_H
// #define AVUTIL_FFVERSION_H
public static final String FFMPEG_VERSION = "7.0";
public static final String FFMPEG_VERSION = "7.0.2";
// #endif /* AVUTIL_FFVERSION_H */


Expand Down
6 changes: 3 additions & 3 deletions platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>7.0-${project.version}</version>
<version>7.0.2-${project.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.bytedeco</groupId>-->
Expand Down Expand Up @@ -307,7 +307,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tensorflow-lite-platform</artifactId>
<version>2.16.1-${project.version}</version>
<version>2.17.0-${project.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
Expand All @@ -317,7 +317,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tritonserver-platform</artifactId>
<version>2.44-${project.version}</version>
<version>2.48.0-${project.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.bytedeco</groupId>-->
Expand Down
6 changes: 3 additions & 3 deletions tensorflow-lite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* TensorFlow Lite 2.16.1 https://www.tensorflow.org/lite
* TensorFlow Lite 2.17.0 https://www.tensorflow.org/lite

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand All @@ -25,7 +25,7 @@ Sample Usage
------------
Here is a simple example of TensorFlow ported to Java from this C++ source file:

* https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/lite/examples/minimal/minimal.cc
* https://github.com/tensorflow/tensorflow/blob/v2.17.0/tensorflow/lite/examples/minimal/minimal.cc

We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `Minimal.java` source files below, simply execute on the command line:
```bash
Expand All @@ -46,7 +46,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tensorflow-lite-platform</artifactId>
<version>2.16.1-1.5.11-SNAPSHOT</version>
<version>2.17.0-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-lite/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ "$EXTENSION" == *gpu ]]; then
export CMAKE_FLAGS="-DTFLITE_ENABLE_GPU=ON"
fi

TENSORFLOW_VERSION=2.16.1
TENSORFLOW_VERSION=2.17.0
download https://github.com/tensorflow/tensorflow/archive/v$TENSORFLOW_VERSION.tar.gz tensorflow-$TENSORFLOW_VERSION.tar.gz

mkdir -p "$PLATFORM$EXTENSION"
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-lite/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>tensorflow-lite-platform</artifactId>
<version>2.16.1-${project.parent.version}</version>
<version>2.17.0-${project.parent.version}</version>
<name>JavaCPP Presets Platform for TensorFlow Lite</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<javacpp.packageName>tensorflowlite</javacpp.packageName>
<tensorflow.version>2.16.1</tensorflow.version>
<tensorflow.version>2.17.0</tensorflow.version>
<tensorflow.path>${basedir}/cppbuild/${javacpp.platform}${javacpp.platform.extension}/tensorflow-${tensorflow.version}/</tensorflow.path>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion tensorflow-lite/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tensorflow-lite-platform</artifactId>
<version>2.16.1-1.5.11-SNAPSHOT</version>
<version>2.17.0-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*
* This combines the effects of TfLiteInterpreterOptionsSetOpResolverExternal
* and TfLiteInterpreterOptionsSetOpResolver. The callbacks that return
* TfLiteRegistrationExternal will be called first, but if they return a
* TfLiteRegistrationExternal object that has no methods set, then
* TfLiteOperator will be called first, but if they return a
* TfLiteOperator object that has no methods set, then
* the callbacks that return a TfLiteRegistration will be called to get
* the methods.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* The {@code TfLiteInterpreterOptionsSetOpResolverExternal} function provides an
* alternative method for registering builtin ops and/or custom ops, by
* providing operator resolver callbacks. Unlike using
* {@code TfLiteInterpreterOptionsAddRegistrationExternal},
* {@code TfLiteInterpreterOptionsAddOperator},
* {@code TfLiteInterpreterOptionsAddBuiltinOp} and/or
* {@code TfLiteInterpreterOptionsAddAddCustomOp}, these let you register all the
* operators in a single call.
Expand All @@ -26,7 +26,7 @@
* If {@code op_resolver_user_data} is non-null, its lifetime must be at least as
* long as the lifetime of the {@code TfLiteInterpreterOptions}.
*
* The TfLiteRegistrationExternal objects whose addresses are returned by
* The TfLiteOperator objects whose addresses are returned by
* {@code find_builtin_op} and {@code find_custom_op} must outlive both the
* InterpreterOptions object and any Interpreter object created from it.
*
Expand All @@ -38,6 +38,6 @@ public class Find_builtin_op_external_Pointer_int_int extends FunctionPointer {
public Find_builtin_op_external_Pointer_int_int(Pointer p) { super(p); }
protected Find_builtin_op_external_Pointer_int_int() { allocate(); }
private native void allocate();
public native @Const TfLiteRegistrationExternal call(Pointer user_data,
int op, int version);
public native @Const TfLiteOperator call(Pointer user_data, int op,
int version);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class Find_custom_op_external_Pointer_String_int extends FunctionPointer
public Find_custom_op_external_Pointer_String_int(Pointer p) { super(p); }
protected Find_custom_op_external_Pointer_String_int() { allocate(); }
private native void allocate();
public native @Const TfLiteRegistrationExternal call(Pointer user_data,
@Cast("const char*") BytePointer custom_op,
int version);
public native @Const TfLiteOperator call(Pointer user_data,
@Cast("const char*") BytePointer custom_op, int version);
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,32 @@ public class FlatBufferModel extends Pointer {
public static native @UniquePtr FlatBufferModel VerifyAndBuildFromFile(
String filename);

/** Builds a model based on a file descriptor.
* Caller retains ownership of {@code error_reporter} and must ensure its lifetime
* is longer than the FlatBufferModel instance. Caller retains ownership of
* {@code fd} and must ensure it is closed after BuildFromFile returns.
* Returns a nullptr in case of failure. */
public static native @UniquePtr FlatBufferModel BuildFromFileDescriptor(
int fd,
ErrorReporter error_reporter/*=tflite::DefaultErrorReporter()*/);
public static native @UniquePtr FlatBufferModel BuildFromFileDescriptor(
int fd);

/** Verifies whether the content of the file descriptor is legit, then builds
* a model based on the file.
* The extra_verifier argument is an additional optional verifier for the
* file contents. By default, we always check with tflite::VerifyModelBuffer.
* If extra_verifier is supplied, the file contents is also checked against
* the extra_verifier after the check against tflite::VerifyModelBuilder.
* Caller retains ownership of {@code error_reporter} and must ensure its lifetime
* is longer than the FlatBufferModel instance.
* Returns a nullptr in case of failure. */
public static native @UniquePtr FlatBufferModel VerifyAndBuildFromFileDescriptor(
int fd, TfLiteVerifier extra_verifier/*=nullptr*/,
ErrorReporter error_reporter/*=tflite::DefaultErrorReporter()*/);
public static native @UniquePtr FlatBufferModel VerifyAndBuildFromFileDescriptor(
int fd);

/** Builds a model based on a pre-loaded flatbuffer.
* Caller retains ownership of the buffer and should keep it alive until
* the returned object is destroyed. Caller also retains ownership of
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.tensorflowlite;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.tensorflowlite.global.tensorflowlite.*;


/** Sets the deallocation callback for the registration, similarly to
* {@code TfLiteOperatorSetFree}. The function returns an error upon failure.
*
* This callback is called to deallocate the data returned by the init
* callback. The value passed in the {@code data} parameter is the value that was
* returned by the {@code init} callback. The value passed in the {@code user_data}
* parameter is the value that was passed to {@code TfLiteOperatorCreateWithData}.
* Please refer {@code free} of {@code TfLiteRegistration} for the detail.
* */
@Properties(inherit = org.bytedeco.tensorflowlite.presets.tensorflowlite.class)
public class Free_Pointer_TfLiteOpaqueContext_Pointer extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Free_Pointer_TfLiteOpaqueContext_Pointer(Pointer p) { super(p); }
protected Free_Pointer_TfLiteOpaqueContext_Pointer() { allocate(); }
private native void allocate();
public native void call(Pointer user_data, TfLiteOpaqueContext context, Pointer data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import static org.bytedeco.tensorflowlite.global.tensorflowlite.*;


// Sets the deallocation callback for the registration.
//
// This callback is called to deallocate the data returned by the init callback.
// The value passed in the `data` parameter is the value that was returned by
// the `init` callback.
// Please refer `free` of `TfLiteRegistration` for the detail.
//
// \warning This is an experimental API and subject to change.
/** Sets the deallocation callback for the registration.
*
* This callback is called to deallocate the data returned by the init
* callback. The value passed in the {@code data} parameter is the value that was
* returned by the {@code init} callback. Please refer {@code free} of {@code TfLiteRegistration}
* for the detail.
*
* Deprecated: Use {@code TfLiteOperatorSetFreeWithData} */
@Properties(inherit = org.bytedeco.tensorflowlite.presets.tensorflowlite.class)
public class Free_TfLiteOpaqueContext_Pointer extends FunctionPointer {
static { Loader.load(); }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.tensorflowlite;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.tensorflowlite.global.tensorflowlite.*;


/** Sets the initialization callback for the registration. The function returns
* an error upon failure.
*
* The callback is called to initialize the op from serialized data. The value
* passed in the {@code user_data} parameter is the value that was passed to
* {@code TfLiteOperatorCreateWithData}. Please refer {@code init} of {@code TfLiteRegistration}
* for the detail.
* */
@Properties(inherit = org.bytedeco.tensorflowlite.presets.tensorflowlite.class)
public class Init_Pointer_TfLiteOpaqueContext_BytePointer_long extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Init_Pointer_TfLiteOpaqueContext_BytePointer_long(Pointer p) { super(p); }
protected Init_Pointer_TfLiteOpaqueContext_BytePointer_long() { allocate(); }
private native void allocate();
public native Pointer call(Pointer user_data, TfLiteOpaqueContext context,
@Cast("const char*") BytePointer buffer, @Cast("size_t") long length);
}
Loading

0 comments on commit 40fdd78

Please sign in to comment.