Package deepboof.io
Class DeepBoofDataBaseOps
java.lang.Object
deepboof.io.DeepBoofDataBaseOps
public class DeepBoofDataBaseOps
extends java.lang.Object
Functions for obtaining and processing network models
-
Constructor Summary
Constructors Constructor Description DeepBoofDataBaseOps() -
Method Summary
Modifier and Type Method Description static voiddecompressTGZ(java.io.File src, java.io.File dst)static voiddecompressZip(java.io.File src, java.io.File dst, boolean deleteZip)static voiddownload(java.lang.String location, java.io.File output)Downloads the specified URL.static intdownload(java.util.List<java.lang.String> urls, java.io.File output)Will attempt to download the file from the list of URLs.static java.io.FiledownloadModel(java.lang.String address, java.io.File destination)static java.io.FiledownloadModel(java.util.List<java.lang.String> addresses, java.io.File destination)Attempts to download a model from the list of addresses.static voidmoveInsideAndDeleteDir(java.io.File srcDir, java.io.File dstDir)Moves everything that's inside the source directory into the destination directory then deletes the source dir.
-
Constructor Details
-
DeepBoofDataBaseOps
public DeepBoofDataBaseOps()
-
-
Method Details
-
downloadModel
public static java.io.File downloadModel(java.util.List<java.lang.String> addresses, java.io.File destination)Attempts to download a model from the list of addresses. If one fails it will try the next in the list. After downloading the model it will then unzip it and return the path to the unzipped directory. It is assumed the unzipped directory's name is the same as the file it's compressed in.- Parameters:
addresses- List of address that it can be downloaded fromdestination- Directory that the file should be downloaded to and decompressed in- Returns:
- The directory containing the decompressed model
-
downloadModel
public static java.io.File downloadModel(java.lang.String address, java.io.File destination)- Parameters:
address- Address to downloaded fromdestination- Directory that the file should be downloaded to and decompressed in- Returns:
- The directory containing the decompressed model
- See Also:
downloadModel(List, File)
-
download
public static int download(java.util.List<java.lang.String> urls, java.io.File output)Will attempt to download the file from the list of URLs. If one failes it will go to the next in the list after printing why it failed- Parameters:
urls- Sources for the fileoutput- Where to save the file to- Returns:
- Index of url it downloaded or -1 if it failed
-
download
public static void download(java.lang.String location, java.io.File output) throws java.io.IOExceptionDownloads the specified URL. Throws an IOException if it fails for any reason. Prints out information and status to console- Parameters:
location- Location of fileoutput- Where it will save the downloaded file to- Throws:
java.io.IOException- Thrown if anything goes wrong
-
decompressTGZ
public static void decompressTGZ(java.io.File src, java.io.File dst) -
decompressZip
public static void decompressZip(java.io.File src, java.io.File dst, boolean deleteZip) -
moveInsideAndDeleteDir
public static void moveInsideAndDeleteDir(java.io.File srcDir, java.io.File dstDir)Moves everything that's inside the source directory into the destination directory then deletes the source dir.- Parameters:
srcDir- source directorydstDir- destination directory
-