Skip to content

Commit

Permalink
Adds some ways to output training results (#2)
Browse files Browse the repository at this point in the history
* allows for this extension to be added into the QuPath source for debugging

* saves the output of the command runner to a string array

* adds logging and logging display possibilities

* updates javadoc and readme

* updates javadoc
  • Loading branch information
lacan authored Jan 21, 2022
1 parent cb93155 commit 8c195c4
Show file tree
Hide file tree
Showing 31 changed files with 324 additions and 160 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,19 @@ def cellpose = Cellpose2D.builder("cyto") // Can choose "None" if you want to tr
// 2. Run the cellpose training via command line
// 3. Recover the model file after training, and copy it to where you defined in the builder, returning the reference to it
def resultModel = cellposeTrainer.train()
def resultModel = cellpose.train()
// Pick up results to see how the training was performed
println "Model Saved under "
println resultModel.getAbsolutePath().toString()
// You can get a ResultsTable of the training.
def results = cellpose.getTrainingResults()
results.show("Training Results")
// Finally you have access to a very simple graph
cellpose.showTrainingGraph()
println "Model Saved under "+resultModel
```

**Extra training options:**
Expand Down
26 changes: 0 additions & 26 deletions Scripts/Run-Cellpose.groovy

This file was deleted.

23 changes: 0 additions & 23 deletions Scripts/Train-Cellpose-Model.groovy

This file was deleted.

2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ plugins {
id 'java-library'
// To create a shadow/fat jar, including dependencies
id 'com.github.johnrengelman.shadow' version '7.0.0'
// To manage included native libraries
id 'org.bytedeco.gradle-javacpp-platform' version '1.5.6'
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions docs/allclasses-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>All Classes (qupath-extension-cellpose 0.2.0 API)</title>
<title>All Classes (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="All Classes (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="All Classes (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down
2 changes: 1 addition & 1 deletion docs/allclasses.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>All Classes (qupath-extension-cellpose 0.2.0 API)</title>
<title>All Classes (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand Down
4 changes: 2 additions & 2 deletions docs/allpackages-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>All Packages (qupath-extension-cellpose 0.2.0 API)</title>
<title>All Packages (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="All Packages (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="All Packages (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down
4 changes: 2 additions & 2 deletions docs/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Constant Field Values (qupath-extension-cellpose 0.2.0 API)</title>
<title>Constant Field Values (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="Constant Field Values (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down
4 changes: 2 additions & 2 deletions docs/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Deprecated List (qupath-extension-cellpose 0.2.0 API)</title>
<title>Deprecated List (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Deprecated List (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="Deprecated List (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down
4 changes: 2 additions & 2 deletions docs/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>API Help (qupath-extension-cellpose 0.2.0 API)</title>
<title>API Help (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API Help (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="API Help (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down
25 changes: 21 additions & 4 deletions docs/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Index (qupath-extension-cellpose 0.2.0 API)</title>
<title>Index (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Index (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="Index (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down Expand Up @@ -277,10 +277,20 @@ <h2 class="title">G</h2>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeExtension.html#getName()">getName()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeExtension.html" title="class in qupath.ext.biop.cellpose">CellposeExtension</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/Cellpose2D.html#getOutputLog()">getOutputLog()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/Cellpose2D.html" title="class in qupath.ext.biop.cellpose">Cellpose2D</a></dt>
<dd>
<div class="block">Returns the log from running the cellpose command, with any error messages and status updates of the cellpose process
You can use this during training or prediction</div>
</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeExtension.html#getQuPathVersion()">getQuPathVersion()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeExtension.html" title="class in qupath.ext.biop.cellpose">CellposeExtension</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeExtension.html#getRepository()">getRepository()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeExtension.html" title="class in qupath.ext.biop.cellpose">CellposeExtension</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/Cellpose2D.html#getTrainingResults()">getTrainingResults()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/Cellpose2D.html" title="class in qupath.ext.biop.cellpose">Cellpose2D</a></dt>
<dd>
<div class="block">Returns a parsed version of the cellpose log as a ResultsTable with columns
Epoch, Time, Loss, Loss Test and LR</div>
</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeExtension.html#getVersion()">getVersion()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeExtension.html" title="class in qupath.ext.biop.cellpose">CellposeExtension</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeSetup.html#getVersion()">getVersion()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeSetup.html" title="class in qupath.ext.biop.cellpose">CellposeSetup</a></dt>
Expand Down Expand Up @@ -451,6 +461,10 @@ <h2 class="title">S</h2>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/CellposeSetup.html#setVersion(qupath.ext.biop.cellpose.CellposeSetup.CellposeVersion)">setVersion(CellposeSetup.CellposeVersion)</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/CellposeSetup.html" title="class in qupath.ext.biop.cellpose">CellposeSetup</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/Cellpose2D.html#showTrainingGraph()">showTrainingGraph()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/Cellpose2D.html" title="class in qupath.ext.biop.cellpose">Cellpose2D</a></dt>
<dd>
<div class="block">Displays a JavaFX graph as a dialog so you can inspect the Losses per epoch</div>
</dd>
</dl>
<a id="I:T">
<!-- -->
Expand All @@ -474,7 +488,10 @@ <h2 class="title">T</h2>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.EnvType.html#toString()">toString()</a></span> - Method in enum qupath.ext.biop.cmd.<a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.EnvType.html" title="enum in qupath.ext.biop.cmd">VirtualEnvironmentRunner.EnvType</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/Cellpose2D.html#train()">train()</a></span> - Method in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/Cellpose2D.html" title="class in qupath.ext.biop.cellpose">Cellpose2D</a></dt>
<dd>&nbsp;</dd>
<dd>
<div class="block">Executes the cellpose training by
1.</div>
</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cellpose/Cellpose2D.html#trainDirectory">trainDirectory</a></span> - Variable in class qupath.ext.biop.cellpose.<a href="qupath/ext/biop/cellpose/Cellpose2D.html" title="class in qupath.ext.biop.cellpose">Cellpose2D</a></dt>
<dd>&nbsp;</dd>
</dl>
Expand Down Expand Up @@ -527,7 +544,7 @@ <h2 class="title">V</h2>
<dd>
<div class="block">A wrapper to run python virtualenvs, that tries to figure out the commands to run based on the environment type</div>
</dd>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.html#%3Cinit%3E(java.lang.String,qupath.ext.biop.cmd.VirtualEnvironmentRunner.EnvType)">VirtualEnvironmentRunner(String, VirtualEnvironmentRunner.EnvType)</a></span> - Constructor for class qupath.ext.biop.cmd.<a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.html" title="class in qupath.ext.biop.cmd">VirtualEnvironmentRunner</a></dt>
<dt><span class="memberNameLink"><a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.html#%3Cinit%3E(java.lang.String,qupath.ext.biop.cmd.VirtualEnvironmentRunner.EnvType,java.lang.String)">VirtualEnvironmentRunner(String, VirtualEnvironmentRunner.EnvType, String)</a></span> - Constructor for class qupath.ext.biop.cmd.<a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.html" title="class in qupath.ext.biop.cmd">VirtualEnvironmentRunner</a></dt>
<dd>&nbsp;</dd>
<dt><a href="qupath/ext/biop/cmd/VirtualEnvironmentRunner.EnvType.html" title="enum in qupath.ext.biop.cmd"><span class="typeNameLink">VirtualEnvironmentRunner.EnvType</span></a> - Enum in <a href="qupath/ext/biop/cmd/package-summary.html">qupath.ext.biop.cmd</a></dt>
<dd>
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Overview (qupath-extension-cellpose 0.2.0 API)</title>
<title>Overview (qupath-extension-cellpose 0.3.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
Expand All @@ -20,7 +20,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Overview (qupath-extension-cellpose 0.2.0 API)";
parent.document.title="Overview (qupath-extension-cellpose 0.3.1 API)";
}
}
catch(err) {
Expand Down Expand Up @@ -91,7 +91,7 @@
</nav>
</header>
<div class="header">
<h1 class="title">qupath-extension-cellpose 0.2.0 API</h1>
<h1 class="title">qupath-extension-cellpose 0.3.1 API</h1>
</div>
<main role="main">
<div class="contentContainer">
Expand Down
Loading

0 comments on commit 8c195c4

Please sign in to comment.