Docker template updated (only the read_image function in the inference.py file)

Docker template updated (only the read_image function in the inference.py file)  

  By: dorian_kauffmann on Feb. 19, 2025, 11:04 a.m.

For those who have problems in creating and/or submitting their docker or those who just want to start ;

I've updated the read_image function in the inference.py file thanks to the Problems in submission forum channel** and @danifranco's contribution.

You can either update it by downloading the updated Docker template here or by visiting the code in the forum topic here.

 Last edited by: dorian_kauffmann on Feb. 28, 2025, 10:53 a.m., edited 2 times in total.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: JasonMendoza2008 on Feb. 24, 2025, 3:55 p.m.

How do you test the algorithm before making a submission ('Try-out algorithm' menu)?

1/ If I upload one of the angle files we have in the training set, I get "Cancelled, One or more of the inputs failed validation." (Result ID a74d42b6-47a2-4fb5-8f4b-982e717f0700).

2/ If I use one of the pre-uploaded tif files of Grand Challenge, I get:

2025-02-24T14:41:37.367000+00:00 Traceback (most recent call last):
2025-02-24T14:41:37.367000+00:00   File "/opt/app/inference.py", line 130, in <module>
2025-02-24T14:41:37.368000+00:00     raise SystemExit(run())
2025-02-24T14:41:37.368000+00:00                      ^^^^^
2025-02-24T14:41:37.368000+00:00   File "/opt/app/inference.py", line 54, in run
2025-02-24T14:41:37.368000+00:00     save_image(
2025-02-24T14:41:37.368000+00:00   File "/opt/app/inference.py", line 117, in save_image
2025-02-24T14:41:37.368000+00:00     PhysicalSizeX = metadata['PhysicalSizeX']
2025-02-24T14:41:37.368000+00:00                     ~~~~~~~~^^^^^^^^^^^^^^^^^
2025-02-24T14:41:37.368000+00:00 KeyError: 'PhysicalSizeX'

So I imagine the pre-uploaded file by the platform don't have metadata (or not the same as the Fuse My Cells challenge images)?

So I'm a bit confused, have I missed something?

 Last edited by: JasonMendoza2008 on Feb. 25, 2025, 8:54 a.m., edited 2 times in total.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: dorian_kauffmann on Feb. 25, 2025, 8:45 a.m.

Hello,

This Grand Challenge documentation may help you test your algorithm https://grand-challenge.org/documentation/try-out-your-algorithm/.

It seems that you have tried your algorithm on another type of image that does not correspond to our challenge. I invite you to choose “upload a new image” and take an image from the training database. As you have 5 submissions for the test phase, you can also try with the test images.

Did it help?

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: JasonMendoza2008 on Feb. 25, 2025, 8:53 a.m.

Hi, as mentioned previously, if I upload one of the angle files we have in our Fuse My Cells training set, I get "Cancelled, One or more of the inputs failed validation."

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: JasonMendoza2008 on Feb. 25, 2025, 9 a.m.

More details:

 Last edited by: JasonMendoza2008 on Feb. 25, 2025, 9 a.m., edited 2 times in total.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: dorian_kauffmann on Feb. 25, 2025, 9:57 a.m.

Do you have logs?
It's a naive question, but have you checked that the entries/inputs are well being read in your docker?
Because it looks like the image is being imported thanks to your images, but as no entries/inputs have been found, it can't be working.

 Last edited by: dorian_kauffmann on Feb. 25, 2025, 9:57 a.m., edited 1 time in total.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: JasonMendoza2008 on Feb. 25, 2025, 10:40 a.m.

I get "No logs found on stdout" and "No logs found on stderr". I don't think I've changed anything docker related compared to the template you provided, except I'm using Python 3.12. But if it was code-related I would have logs right?

Especially since it works with the pre-uploaded images of Grand Challenge (they just don't have the metadata we have here for FuseMyCells).

Sorry I'm not very good with Docker so I don't know how to provide more information.

EDIT: it might be a problem with my code, weird that I didn't have a stderr. Currently looking into it. Sorry.

 Last edited by: JasonMendoza2008 on Feb. 26, 2025, 10:34 a.m., edited 2 times in total.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: dorian_kauffmann on Feb. 26, 2025, 2:27 p.m.

Hi JasonMendoza2008,

I contacted Grand Challenge for further clarification and tested the try-out algorithm with our test algorithm. Thanks to their help and efforts, it turns out that the selected image (image_189_nucleus_angle.tif) does not pass Grand Challenge’s basic validation.

As a result, you can upload your image, but it cannot be read or imported.

When I tried, I received the following message:

Image validation for interface Fluorescence Lightsheet 3D Microscopy failed with error: 1 file could not be imported.

It seems that this issue stems from our writer. We used imwrite from tifffile, and it appears that when we set the parameter imagej=True(which we did for the training database), Grand Challenge is unable to import and validate the image.

I've rewritten the image with imagej=False, but the image you chose is quite heavy (1.2Go) so I've rewritten another one lighter, (i.e. 2 images in total)

you can download them here


I've tested and it works :


I hope this could help you, do not hesitate if you have other issues.

Sincerely,
Dorian

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: JasonMendoza2008 on Feb. 26, 2025, 2:36 p.m.

Hi, that's great, thank you so much for the investigation. I'll use both the images you provided for validation from now on.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: cyril.meyer.68 on Feb. 27, 2025, 8:01 p.m.

Current link "https://seafile.lirmm.fr/d/a952ce4f99484be2ad72/" seems dead :

"/Fusemycells/docker_template/" n'existe pas.

Re: Docker template updated (only the read_image function in the inference.py file)  

  By: dorian_kauffmann on Feb. 28, 2025, 10:56 a.m.

Thank you for the post!

I don't know what happened, here is the new link (updated also on the docker page of the website)

https://seafile.lirmm.fr/d/233a5a399c8544dfb41a/