-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto download faceboxes and tensorflow libs; Fixes; Refactored;
- Loading branch information
Showing
32 changed files
with
294 additions
and
9,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
def tensorflowDownloadUrl = 'https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow_jni-cpu-darwin-x86_64-2.3.0.tar.gz' | ||
def faceboxesDownloadUrl = 'https://drive.google.com/uc?export=download&id=18XrleLvdSujoNTgxHsJFtNPHOirnWlbV' | ||
|
||
project.ext.tensorFlowTempLocalFolder = "tensorflow.tar.gz" | ||
project.ext.faceboxesTempLocalFile = "faceboxes_model.pb" | ||
|
||
project.ext.faceboxes = 'faceboxes' | ||
project.ext.tensorflow = 'tensorflow' | ||
|
||
project.ext.ASSET_DIR_TF = projectDir.toString() + '/libs/' //for tf dylib | ||
project.ext.ASSET_DIR = projectDir.toString() + '/src/main/resources/' | ||
project.ext.TMP_DIR = project.buildDir.toString() + '/downloads' | ||
|
||
def targetFaceboxesFolder = project.ext.ASSET_DIR + project.ext.faceboxes | ||
def targetTensorFlowFolder = project.ext.ASSET_DIR_TF | ||
|
||
////////// TensorFlow | ||
|
||
task downloadTensorFlow(type: Download) { | ||
doFirst { | ||
println "Build dir ${buildDir}" | ||
println "Downloading ${tensorflowDownloadUrl}" | ||
} | ||
src tensorflowDownloadUrl | ||
dest new File(buildDir, project.ext.tensorFlowTempLocalFolder) | ||
overwrite false | ||
} | ||
|
||
task downloadAndCopyTensorFlow(dependsOn: downloadTensorFlow, type: Copy) { | ||
doFirst { | ||
println "Copying ${downloadTensorFlow.dest}" | ||
} | ||
from tarTree(downloadTensorFlow.dest) | ||
into targetTensorFlowFolder | ||
doLast { | ||
println "Copied to ${targetTensorFlowFolder}" | ||
} | ||
} | ||
|
||
|
||
////////// Faceboxes | ||
|
||
task downloadFaceboxes(type: Download) { | ||
doFirst { | ||
println "Downloading ${faceboxesDownloadUrl}" | ||
} | ||
src faceboxesDownloadUrl | ||
dest new File(buildDir, project.ext.faceboxesTempLocalFile) | ||
overwrite false | ||
} | ||
|
||
task downloadAndCopyFaceboxes(dependsOn: downloadFaceboxes, type: Copy) { | ||
doFirst { | ||
println "Copying ${downloadFaceboxes.dest}" | ||
} | ||
from downloadFaceboxes.dest | ||
into targetFaceboxesFolder | ||
doLast { | ||
println "Copied to ${targetFaceboxesFolder}" | ||
} | ||
} | ||
|
||
|
||
task extractModels(type: Copy) { | ||
dependsOn downloadAndCopyFaceboxes | ||
dependsOn downloadAndCopyTensorFlow | ||
} | ||
|
||
tasks.whenTaskAdded { task -> | ||
if (task.name == 'assemble') { | ||
task.dependsOn 'extractModels' | ||
} | ||
} |
Binary file not shown.
203 changes: 0 additions & 203 deletions
203
jvm-sample/libs/libtensorflow_jni-cpu-darwin-x86_64-2.3.0/LICENSE
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.