mtorkashvand / compact-flourescent-microscope

Low-Cost Compact Flourescent Tracking Microscope
MIT License
0 stars 0 forks source link

Tracking using Neural Networks #4

Open SinRas opened 1 year ago

SinRas commented 1 year ago

@mtorkashvand missing anything?

mtorkashvand commented 1 year ago

@SinRas Where can I find the notebook for this?

SinRas commented 1 year ago

@mtorkashvand here is the link to the file https://github.com/mtorkashvand/compact-flourescent-microscope/blob/main/network/20230613_annotated_data_loader.ipynb

mtorkashvand commented 1 year ago

I added a function that reads annotations from 'annotations.h5' and frames from 'data.h5' (compatible with annotator), and updates a file named 'training_data.h5' located in 'V:\Mahdi\OpenAutoScope2.0\data\training_data'

'training_data.h5' has two groups: 'data' and 'annotations'. the 'annotations' group for each frame is an array of [y, x] coordinates.

mtorkashvand commented 1 year ago

training data:

image worms in following situations:

and the same when the worms are between the glass and and the agar pad:

mtorkashvand commented 1 year ago

I assume we won't use 4x for now because even young adults if tracked properly fit nicely in FoV.

SinRas commented 1 year ago

Just fixed a problem with the "no worm images" data that was used for training. the point of interest was jumping around, causing problem with the learning and also evaluation metrics.

In this commit: https://github.com/mtorkashvand/compact-flourescent-microscope/commit/cd7776c39ae01a6c2c428f6e0afbc557e47f4279

SinRas commented 1 year ago

Reduced Gamma variations since some images were too dark: 902d98d

SinRas commented 1 year ago

MODEL: ResNet18

We I confirm that ONNX running on CPU for Single/Small Batch Size, is much faster than PyTorch!
Roughlt ONNX 1/4 Batch takes 21/86 ms. PyTorch for 1/4 Batch takes 32/147 ms.

Here is the runtime of running model using ONNX and PyTorch on CPU of my laptop:
image

SinRas commented 1 year ago

MODEL: MNASNet0_75

We can see that the run-time roughly proportional to the GFLOP column in PyTorch PreTrained Model Specs.

image