Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version of JavaCPP, JavaCV, and all presets to 1.5-SNAPSHOT #7296

Merged
merged 3 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 9 additions & 34 deletions change-cuda-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@

set -e

VALID_VERSIONS=( 8.0 9.0 9.1 9.2 10.0 )
CUDA_80_VERSION="8\.0"
CUDA_90_VERSION="9\.0"
CUDA_91_VERSION="9\.1"
CUDA_92_VERSION="9\.2"
CUDA_100_VERSION="10\.0"
CUDNN_60_VERSION="6\.0"
CUDNN_70_VERSION="7\.0"
CUDNN_71_VERSION="7\.1"
CUDNN_74_VERSION="7\.4"
JAVACPP_141_VERSION="1\.4\.1"
JAVACPP_142_VERSION="1\.4\.2"
JAVACPP_144_VERSION="1\.4\.4"
VALID_VERSIONS=( 9.2 10.0 10.1 )

usage() {
echo "Usage: $(basename $0) [-h|--help] <cuda version to be used>
Expand All @@ -59,30 +47,17 @@ check_cuda_version() {
check_cuda_version "$VERSION"

case $VERSION in
10.1)
VERSION2="7.5"
VERSION3="1.5-SNAPSHOT"
;;
10.0)
VERSION=$CUDA_100_VERSION
VERSION2=$CUDNN_74_VERSION
VERSION3=$JAVACPP_144_VERSION
VERSION2="7.4"
VERSION3="1.5-SNAPSHOT"
;;
9.2)
VERSION=$CUDA_92_VERSION
VERSION2=$CUDNN_71_VERSION
VERSION3=$JAVACPP_142_VERSION
;;
9.1)
VERSION=$CUDA_91_VERSION
VERSION2=$CUDNN_71_VERSION
VERSION3=$JAVACPP_141_VERSION
;;
9.0)
VERSION=$CUDA_90_VERSION
VERSION2=$CUDNN_70_VERSION
VERSION3=$JAVACPP_141_VERSION
;;
8.0)
VERSION=$CUDA_80_VERSION
VERSION2=$CUDNN_60_VERSION
VERSION3=$JAVACPP_141_VERSION
VERSION2="7.2"
VERSION3="1.5-SNAPSHOT"
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion datavec/datavec-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion datavec/datavec-arrow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion datavec/datavec-camel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>
</project>
4 changes: 2 additions & 2 deletions datavec/datavec-data/datavec-data-audio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<!-- Do not depend on FFmpeg by default due to licensing concerns. -->
<!--
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>${ffmpeg.version}-${javacpp-presets.version}</version>
</dependency>
Expand All @@ -72,7 +72,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;

import static org.bytedeco.javacpp.avutil.AV_SAMPLE_FMT_FLT;
import static org.bytedeco.ffmpeg.global.avutil.AV_SAMPLE_FMT_FLT;

/**
* Native audio file loader using FFmpeg.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.nio.ShortBuffer;
import java.util.List;

import static org.bytedeco.javacpp.avcodec.AV_CODEC_ID_VORBIS;
import static org.bytedeco.ffmpeg.global.avcodec.AV_CODEC_ID_VORBIS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

Expand Down
4 changes: 2 additions & 2 deletions datavec/datavec-data/datavec-data-codec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<!-- Do not depend on FFmpeg by default due to licensing concerns. -->
<!--
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>${ffmpeg.version}-${javacpp-presets.version}</version>
</dependency>
Expand All @@ -66,7 +66,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>
</project>
8 changes: 4 additions & 4 deletions datavec/datavec-data/datavec-data-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@
</dependency>

<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<groupId>org.bytedeco</groupId>
<artifactId>opencv-platform</artifactId>
<version>${opencv.version}-${javacpp-presets.version}</version>
</dependency>

<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<groupId>org.bytedeco</groupId>
<artifactId>leptonica-platform</artifactId>
<version>${leptonica.version}-${javacpp-presets.version}</version>
</dependency>

<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<groupId>org.bytedeco</groupId>
<artifactId>hdf5-platform</artifactId>
<version>${hdf5.version}-${javacpp-presets.version}</version>
</dependency>
Expand All @@ -140,7 +140,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.0</id>
<id>test-nd4j-cuda-10.1</id>
</profile>
</profiles>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.bytedeco.javacpp.opencv_core;
import org.bytedeco.javacv.OpenCVFrameConverter;
import org.nd4j.linalg.api.ops.impl.reduce.same.Sum;
import org.nd4j.linalg.primitives.Pair;
Expand All @@ -35,9 +34,10 @@
import java.nio.ByteBuffer;
import java.util.*;

import static org.bytedeco.javacpp.opencv_core.CV_8UC;
import static org.bytedeco.javacpp.opencv_core.Mat;
import static org.bytedeco.javacpp.opencv_imgproc.COLOR_BGR2YCrCb;
import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

/**
* CifarLoader is loader specific for the Cifar10 dataset
Expand Down Expand Up @@ -264,7 +264,7 @@ private boolean cifarProcessedFilesExists() {
* Preprocess and store cifar based on successful Torch approach by Sergey Zagoruyko
* Reference: <a href="https://github.com/szagoruyko/cifar.torch">https://github.com/szagoruyko/cifar.torch</a>
*/
public opencv_core.Mat convertCifar(Mat orgImage) {
public Mat convertCifar(Mat orgImage) {
numExamples++;
Mat resImage = new Mat();
OpenCVFrameConverter.ToMat converter = new OpenCVFrameConverter.ToMat();
Expand Down Expand Up @@ -325,9 +325,9 @@ public void normalizeCifar(File fileName) {
result.save(fileName);
}

public Pair<INDArray, opencv_core.Mat> convertMat(byte[] byteFeature) {
public Pair<INDArray, Mat> convertMat(byte[] byteFeature) {
INDArray label = FeatureUtil.toOutcomeVector(byteFeature[0], NUM_LABELS);; // first value in the 3073 byte array
opencv_core.Mat image = new opencv_core.Mat(HEIGHT, WIDTH, CV_8UC(CHANNELS)); // feature are 3072
Mat image = new Mat(HEIGHT, WIDTH, CV_8UC(CHANNELS)); // feature are 3072
ByteBuffer imageData = image.createBuffer();

for (int i = 0; i < HEIGHT * WIDTH; i++) {
Expand All @@ -345,7 +345,7 @@ public Pair<INDArray, opencv_core.Mat> convertMat(byte[] byteFeature) {
public DataSet convertDataSet(int num) {
int batchNumCount = 0;
List<DataSet> dataSets = new ArrayList<>();
Pair<INDArray, opencv_core.Mat> matConversion;
Pair<INDArray, Mat> matConversion;
byte[] byteFeature = new byte[BYTEFILELEN];

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
import java.io.*;
import java.nio.ByteOrder;

import static org.bytedeco.javacpp.lept.*;
import static org.bytedeco.javacpp.opencv_core.*;
import static org.bytedeco.javacpp.opencv_imgcodecs.*;
import static org.bytedeco.javacpp.opencv_imgproc.*;
import org.bytedeco.leptonica.*;
import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.leptonica.global.lept.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgcodecs.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

/**
* Uses JavaCV to load images. Allowed formats: bmp, gif, jpg, jpeg, jp2, pbm, pgm, ppm, pnm, png, tif, tiff, exr, webp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import org.datavec.image.recordreader.objdetect.ImageObject;
import org.datavec.image.recordreader.objdetect.ImageObjectLabelProvider;

import static org.bytedeco.javacpp.hdf5.*;
import org.bytedeco.hdf5.*;
import static org.bytedeco.hdf5.global.hdf5.*;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.*;
import org.bytedeco.opencv.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_core.*;

/**
* Boxes images to a given width and height without changing their aspect ratios,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.Mat;
import static org.bytedeco.javacpp.opencv_imgproc.COLOR_BGR2Luv;
import static org.bytedeco.javacpp.opencv_imgproc.cvtColor;
import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

/**
* Color conversion transform using CVT (cvtcolor):
* <a href="http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor">CVT Color</a>.
* <a href="http://bytedeco.org/javacpp-presets/opencv/apidocs/org/bytedeco/javacpp/opencv_imgproc.html#cvtColor-org.bytedeco.javacpp.opencv_core.Mat-org.bytedeco.javacpp.opencv_core.Mat-int-int-">More CVT Color</a>.
* <a href="https://docs.opencv.org/4.0.1/de/d25/imgproc_color_conversions.html">CVT Color</a>.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class ColorConversionTransform extends BaseImageTransform {

/**
* Color Conversion code
* {@link org.bytedeco.javacpp.opencv_imgproc}
* {@link org.bytedeco.opencv.global.opencv_imgproc}
*/
private int conversionCode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.Mat;
import static org.bytedeco.javacpp.opencv_core.Rect;
import org.bytedeco.opencv.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_core.*;

/**
* Crops images deterministically or randomly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.*;
import static org.bytedeco.javacpp.opencv_imgproc.CV_BGR2GRAY;
import static org.bytedeco.javacpp.opencv_imgproc.equalizeHist;
import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

/**
* "<a href="https://opencv-srf.blogspot.com/2013/08/histogram-equalization.html">Histogram Equalization</a> equalizes the intensity distribution of an image or flattens the intensity distribution curve.
Expand All @@ -40,7 +41,7 @@ public class EqualizeHistTransform extends BaseImageTransform {

/**
* Color Conversion code
* {@link org.bytedeco.javacpp.opencv_imgproc}
* {@link org.bytedeco.opencv.global.opencv_imgproc}
*/
private int conversionCode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import java.util.Random;

import static org.bytedeco.javacpp.avutil.*;
import static org.bytedeco.ffmpeg.global.avutil.*;

/**
* Filters images using FFmpeg (libavfilter):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.Mat;
import static org.bytedeco.javacpp.opencv_core.flip;
import org.bytedeco.opencv.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_core.*;

/**
* Flips images deterministically or randomly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.*;
import static org.bytedeco.javacpp.opencv_imgproc.*;
import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

/**
* crop images based on it's largest blob. Calls internally
* {@link org.bytedeco.javacpp.opencv_imgproc#blur(Mat, Mat, Size)}
* {@link org.bytedeco.javacpp.opencv_imgproc#Canny(Mat ,Mat, double, double)}
* {@link org.bytedeco.javacpp.opencv_imgproc#threshold(Mat, Mat, double, double, int)}
* {@link org.bytedeco.javacpp.opencv_imgproc#findContours(Mat, MatVector, Mat, int, int)}
* {@link org.bytedeco.javacpp.opencv_imgproc#contourArea(Mat, boolean)}
* {@link org.bytedeco.opencv.global.opencv_imgproc#blur(Mat, Mat, Size)}
* {@link org.bytedeco.opencv.global.opencv_imgproc#Canny(Mat ,Mat, double, double)}
* {@link org.bytedeco.opencv.global.opencv_imgproc#threshold(Mat, Mat, double, double, int)}
* {@link org.bytedeco.opencv.global.opencv_imgproc#findContours(Mat, MatVector, Mat, int, int)}
* {@link org.bytedeco.opencv.global.opencv_imgproc#contourArea(Mat, boolean)}
*
* @author antdood
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import java.util.Random;

import static org.bytedeco.javacpp.opencv_core.Mat;
import org.bytedeco.opencv.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_core.*;

/**
* Transforms images deterministically or randomly with the help of an array of ImageTransform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

import java.util.*;

import static org.bytedeco.javacpp.opencv_core.Mat;
import org.bytedeco.opencv.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_core.*;

/**
* Allows creation of image transform pipelines, either sequentially or randomly.
Expand Down
Loading