diff --git a/frontend/javascripts/oxalis/model/sagas/automatic_brush_saga.js b/frontend/javascripts/oxalis/model/sagas/automatic_brush_saga.js index 1b11074a9ae..91c44590bb4 100644 --- a/frontend/javascripts/oxalis/model/sagas/automatic_brush_saga.js +++ b/frontend/javascripts/oxalis/model/sagas/automatic_brush_saga.js @@ -30,7 +30,6 @@ const outputExtent = 100; const inputContextExtent = 20; const inputExtent = outputExtent + 2 * inputContextExtent; const NUM_PREDICT_SLICES = 3; -const FLOODFILL_THRESHOLD = 0.7; // Will remove model validation, NaN checks, and other correctness checks in favor of performance if (process.env.NODE_ENV === "production") tf.enableProdMode(); @@ -85,7 +84,10 @@ const getPredictionForTile = async ( }); const { mean, stdDev } = await meanAndStdDevFromDataset(dataset, colorLayerName); - const tensorArray = new Float32Array(new Uint8Array(cuboidData)).map(el => (el - mean) / stdDev); + const tensorArray = new Float32Array(new Uint8Array(cuboidData)).map( + // This is how the model was trained + el => ((el - mean) / stdDev) * (1 / 3) ** 0.5, + ); // When interpreting the 3d data slice as a 2d slice, the x and y axis are flipped only on the YZ plane const isXYflipped = activeViewport === OrthoViews.PLANE_YZ; const { useWebworker, useGPU } = getUseWebworkerAndGPU(); @@ -125,6 +127,8 @@ export default function* inferSegmentInViewport( const activeViewport = yield* select(state => state.viewModeData.plane.activeViewport); if (activeViewport === "TDView") return; + const FLOODFILL_THRESHOLD = window.floodfillThreshold || 0.6; + let aborted = false; const toastConfig = { onClose: () => { diff --git a/package.json b/package.json index e99f0264325..e6eb7d5c165 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,6 @@ "mini-css-extract-plugin": "^0.4.0", "mjs": "^1.0.0", "moment": "^2.21.0", - "n-dimensional-flood-fill": "^1.0.0", "nanoevents": "^1.0.2", "pako": "^0.2.8", "pretty-bytes": "^5.1.0", diff --git a/public/tf-models/group1-shard1of1 b/public/tf-models/group1-shard1of1 index 11af0ca5ecb..6dde0e624bf 100644 Binary files a/public/tf-models/group1-shard1of1 and b/public/tf-models/group1-shard1of1 differ diff --git a/yarn.lock b/yarn.lock index 6c69d292da4..8584cbc95e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7746,11 +7746,6 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -n-dimensional-flood-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/n-dimensional-flood-fill/-/n-dimensional-flood-fill-1.0.0.tgz#c1b99ed55901f9edcd50e86997ee355109b3601b" - integrity sha1-wbme1VkB+e3NUOhpl+41UQmzYBs= - n-gram@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/n-gram/-/n-gram-1.1.0.tgz#c07fb7d6d59aa42d10fbf680fc4c46a30766c1ee"