generated from qupath/qupath-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement local model support, see #32
- Loading branch information
1 parent
f84c688
commit fb829cb
Showing
9 changed files
with
117 additions
and
28 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
35 changes: 35 additions & 0 deletions
35
src/main/java/qupath/ext/wsinfer/models/WSInferModelLocal.java
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,35 @@ | ||
package qupath.ext.wsinfer.models; | ||
|
||
import qupath.ext.wsinfer.ui.WSInferPrefs; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
public class WSInferModelLocal extends WSInferModel { | ||
|
||
private final File modelDirectory; | ||
|
||
public WSInferModelLocal(File modelDirectory) { | ||
this.modelDirectory = modelDirectory; | ||
this.hfRepoId = modelDirectory.getName(); | ||
// todo: load any files, populate fields from them. | ||
} | ||
|
||
@Override | ||
File getModelDirectory() { | ||
return this.modelDirectory; | ||
} | ||
|
||
@Override | ||
public boolean isValid() { | ||
return getTSFile().exists() && getConfiguration() != null; | ||
} | ||
|
||
@Override | ||
public synchronized void downloadModel() {} | ||
|
||
@Override | ||
public synchronized void removeCache() {} | ||
} |
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
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