talmo / leap

LEAP is now deprecated -- check out its successor SLEAP!
https://sleap.ai
Apache License 2.0
206 stars 48 forks source link

Warning: Image is too big to fit on screen #12

Closed xiaonansun closed 5 years ago

xiaonansun commented 5 years ago

Hi Talmo, I am trying to create a skeleton on my data but there seems to be an error possibly associated with the dimensions of the video. The dimensions are certainly divisible by 4 but it's non-square. The error I am getting is Warning: Image is too big to fit on screen; displaying at 200% after pressing the "Import from workspace" button in the Create skeleton GUI window, generating a new "Select default body part positions" window which is blank. Do I need to downsample my video?

Thank you for your help.

Best,

Richard

image

image

xiaonansun commented 5 years ago

also, this is the h5disp for this video: Dataset 'box' Size: 512x640x1x275 MaxSize: 512x640x1x275 Datatype: H5T_IEEE_F64LE (double) ChunkSize: 512x640x1x1 Filters: deflate(1) FillValue: 0.000000 Attributes: 'dtype': 'double' Dataset 'dataIdx' Size: 275x1 MaxSize: 275x1 Datatype: H5T_IEEE_F64LE (double) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'double' Dataset 'exptID' Size: 275x1 MaxSize: 275x1 Datatype: H5T_IEEE_F64LE (double) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'double' Group '/clusters' Dataset 'G' Size: 275x1 MaxSize: 275x1 Datatype: H5T_IEEE_F64LE (double) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'double' Dataset 'cluster_centroids' Size: 512x640x1x5 MaxSize: 512x640x1x5 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'k' Size: 1x1 MaxSize: 1x1 Datatype: H5T_IEEE_F64LE (double) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'double' Group '/pca' Dataset 'coeff' Size: 327680x100 MaxSize: 327680x100 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'coeff_box' Size: 512x640x1x100 MaxSize: 512x640x1x100 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'explained' Size: 2159x1 MaxSize: 2159x1 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'latent' Size: 2159x1 MaxSize: 2159x1 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'mu' Size: 1x327680 MaxSize: 1x327680 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'score' Size: 275x100 MaxSize: 275x100 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single' Dataset 'tsquared' Size: 2160x1 MaxSize: 2160x1 Datatype: H5T_IEEE_F32LE (single) ChunkSize: [] Filters: none FillValue: 0.000000 Attributes: 'dtype': 'single'

talmo commented 5 years ago

Hey Richard,

I think the image is showing up as white because it's a double. This is because if the image is a floating point type (single/double), then the expected range of values is in [0, 1] and you probably still have them in the uint8 range of [0, 255] and MATLAB just displays it as all white.

I'd definitely recommend saving out the movie as uint8 if possible -- it'll be way smaller in filesize and it gets auto-converted when loaded into LEAP anyway.

If you need to have floating-point precision, I'd recommend saving it as a single (== float32) which GPUs are much more optimized for than double (== float64) precision.

Regarding the size: I'd definitely resize it down to 256x320 if I were you, at least for the first tests. You might also need to decrease the batch size to make sure you have enough GPU memory and increase the sigma (~8 is probably good) to account for the larger scale of the features.

Give it a go and let me know if you have any issues!

Talmo

xiaonansun commented 5 years ago

Thank you for the quick response Talmo. I'll give it a go and let you know. Best, Richard

xiaonansun commented 5 years ago

Hi Talmo, So everything worked out well. I converted the videos to uint8 and resized by 0.5 x and y. After a few rounds of labeling, the performance is very good.

Now a separate issue regarding applying the trained network: I am having difficulty visualizing predictions using the helper function. I tried this on my data as well as on the sample (Tyson the cat) data you provided. This is what I did modelPath = 'C:\Users\Xiaonan Richard Sun\Documents\leap\models\181212_174020-n=35\final_model.h5'; box = h5read('box.h5','/box'); preds = predict_box(box, modelPath) and everything was fine: preds = struct with fields: Attributes: [1×1 struct] conf_pred: [6×2085 single] positions_pred: [6×2×2085 single] then: skeleton = load('cat-skeleton.mat'); imagesc(box(:,:,:,1)),axis image,hold on,plot_joints_single(preds.positions_pred(:,:,1),skeleton)

Unfortunately this is what I get: image

I feel there's something wrong with the skeleton file I created. I did save this skeleton to file: image

Thanks for your help.

Richard

talmo commented 5 years ago

Hey Richard,

Sorry about that, I think you might need to define the edges to get the visualization working. You can do this by filling in the "parent" column with the name of the other joints, e.g., "head" for the earR or earL.

xiaonansun commented 5 years ago

Got it. Thank you!