From fb1d77eac56538569f639ab58a62470bff10f04c Mon Sep 17 00:00:00 2001 From: Laetitia Hebert Date: Wed, 8 Dec 2021 21:49:51 -0500 Subject: [PATCH] Fixing bug with batches of size 1, no need for a special case anymore Adding more explanations in Tierpsy doc Increase version --- docs/source/tierpsy.rst | 6 +++--- wormpose/images/scoring/results_scoring.py | 10 ---------- wormpose/version.py | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/docs/source/tierpsy.rst b/docs/source/tierpsy.rst index 6aae2e4..2b224f8 100644 --- a/docs/source/tierpsy.rst +++ b/docs/source/tierpsy.rst @@ -25,15 +25,15 @@ Each subdirectory contains one video, the file tree should look like below (note For using `Open Worm Movement Database `__ videos from the `Zenodo `__ website, we provide a `download script `__ that will create the file tree described above. -**Limitations** +**Limitations and troubleshooting** Please use the option "extract timestamp" in Tierpsy so that the field "timestamp/raw" is set in the hdf5 file. The configuration without the timestamp is not currently supported in WormPose. For Tierpsy files with several worm indexes per file, WormPose will only load one worm, the one with the smallest index. -**Troubleshooting** +The Tierpsy coordinates loader uses the 'skeleton' key of the file {video_name}_features.hdf5 or {video_name}_featuresN.hdf5. Please verify that the coordinates of this table are in pixels and not microns or another unit. You may need to leave the default value of Microns Per Pixel = -1.00 in Tierpsy so that the skeletons values stay in image pixel coordinates. -Please contact the authors for any problems loading Tierpsy tracker files. Some features may not be implemented. +Please contact the authors for any problems loading Tierpsy tracker files. Some features may not be implemented, the notebook check_dataset.ipynb is a good starting point to troubleshoot Tierpsy dataset loading issues. **Advanced use** diff --git a/wormpose/images/scoring/results_scoring.py b/wormpose/images/scoring/results_scoring.py index a704dc3..8531717 100644 --- a/wormpose/images/scoring/results_scoring.py +++ b/wormpose/images/scoring/results_scoring.py @@ -82,12 +82,6 @@ def __call__( with open(result_filename, "rb") as f: results_scores, results_skel = pickle.load(f) - # handle case for results containing one centerline - if len(results_scores.shape) == 1: - results_scores = results_scores[:, np.newaxis] - if len(results_skel.shape) == 3: - results_skel = results_skel[:, np.newaxis] - matching_scores.append(results_scores) matching_skeletons.append(results_skel) os.remove(result_filename) @@ -195,10 +189,6 @@ def _compare_pred_real( all_scores[index][flip_index] = score all_skel[index][flip_index] = synth_skel - # for one centerline case - all_scores = all_scores.squeeze() - all_skel = all_skel.squeeze() - out_filename = os.path.join(temp_dir, f"compare_results_{chunk_index:09d}.pkl") with open(out_filename, "wb") as f: diff --git a/wormpose/version.py b/wormpose/version.py index c68196d..67bc602 100644 --- a/wormpose/version.py +++ b/wormpose/version.py @@ -1 +1 @@ -__version__ = "1.2.0" +__version__ = "1.3.0"