deepboof.misc.DeepBoofOps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of main Show documentation
Show all versions of main Show documentation
Trainer Agnostic Deep Learning
package deepboof.misc;
import java.io.File;
/**
* @author Peter Abeles
*/
public class DeepBoofOps {
public static File pathData( String relativePath ) {
return new File(pathToBase(),new File("data",relativePath).getPath());
}
public static File pathToBase() {
File path = new File(".").getAbsoluteFile();
while( true ) {
File[] children = path.listFiles();
boolean foundModules = false;
boolean foundData = false;
boolean foundSettings = false;
for( File c : children ) {
if( c.getName().equals("modules"))
foundModules = true;
else if( c.getName().equals("data"))
foundData = true;
else if( c.getName().equals("settings.gradle"))
foundSettings = true;
}
if( foundModules && foundData && foundSettings )
return path;
path = path.getParentFile();
if( path == null )
throw new RuntimeException("Can't find base of project DeepBoof! Run from inside");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy