-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to design ROIs recursively on a project with >1000 video #406
Comments
Hi @DavidBarriere - thanks for the feedback, appreciate it! Just to re-iterate and confirm so I get this right before I give you a notebook solution: You have >1k videos, and you want to (i) draw the ROIs on one video, (ii) duplicate these ROIs on the subsequent videos, and (iii) iteratively go through the ROIs on the subsequent videos and correct the ROIs. While there is a method to do this in the GUI (by clicking the the APPLY TO ALL button in the ROI interface: .... I can se this becoming tricky in the GUI (having to navigate and scroll though 1000 videos). I will get a notebook together to run this. However, just a heads up, manually opening and correcting 1000s videos can take some time and things could go astray, and it may be best to do e.g., 5 batches of 200 videos.. |
Dear Simon thank you for your rapid reply. Yes It's what I would like to get. I know that it will be a bit painfull but this is the nature of academic research :) |
Cheers @DavidBarriere - there seems to be two issues in the GUI I'd like to look into first before dealing with the notebook if that's OK. You mention it crashes when clicking Second, I guess the videos have large differences in resolutions, and the ROIs drawn on the first video fall largely outside the frame of other videos, making them hard to select and move? We could insert a button named something like "move to center", which moves any selected ROI in the drop-down to the center of the image when clicked, do you think that could solve it? |
No problem. When it crash, there is no message. I think it's a memory problem because videos are big. Videos have been captured under standard conditions in animal facilities with GOPRO camera fixed on the ceil approximately at the same position from the floor. We have 16 facilities and camera have been installed/uninstall after each sessions. I think it's just to huge for the GUI so it's why I try to analyze with SIMBA using command lines. |
@DavidBarriere - when you goy a chance, could you give THIS notebook ago? It is also rendered HERE. Please let me know if I got something wrong, or if it could be improved, or if anything is missing. Check the comments for instructions. And please make sure you are running latest simba with I tried to write a loop in the final cell, to automatically loop over all the videos. However, the ROI tkinter drawing interface was playing up and locking up when doing this in a jupyter notebook, so at least for this first iteration you'd manually have to update the Specifically, when completed the |
Dear Simon thank you so much for your work. I tried the code and I have a first error poping : ModuleNotFoundError Traceback (most recent call last) File ~/.local/lib/python3.8/site-packages/simba/roi_tools/ROI_define.py:13, in File ~/.local/lib/python3.8/site-packages/simba/mixins/config_reader.py:36, in File ~/.local/lib/python3.8/site-packages/simba/utils/lookups.py:15, in ModuleNotFoundError: No module named 'pyglet' |
@DavidBarriere - cheers for testing. Something seems to have gone wrong with the SimBA environment. I am seeing that you are using python3.8, which SimBA probably could have troubles with. Is this the same SimBA environment you have been using before? EDIT PS. Try using python 3.6, or if absolutely necessary for whatever reason, python 3.10. |
Okay, I changed the kernel to 3.6 on jupyter and the command run. |
I think that everything is working but there is some troubles within the GUI display as there is no button displayed and notebook finally crash. Here the terminal : |
Opfhh getting closer! Let me move to a Linux computer and try this a little later, to troubleshoot/ and see if I can replicate - I have only tested on a MS Windows. |
It did get it to run on a Ubuntu 22.04.4 machine.. :/ JUst a few more questions to see what is going wrong: If you print out the python version, and the simba version, in the notebook, what do you see as below? Are your videos/simba project stored on the local machine, or are they located on a server? If a server,would it run on a simple small project that is on the machine, and it freezes up when reaching to the server? |
Can you test one thing to see if it makes a difference: The ROIs are stored in a file at |
No is still the same unfortunately... |
Got it - one question: are you using simba through conda or a virtual environment, or is it through base python? If through base python, does it work in conda? I've tried the notebook on a few machines now, but so far I am failing to recreate the error and trying to figure out what I am doing wrong. |
I am working within a conda env because I need a python3.12 for another application. Maybe something wrong with Tkinter one my side |
Ah I think I got it, I was able to replicate the freezing you saw earlier when I initated a jupyter notebook istance outside the IDE on Ubuntu, and I have a potential fix. |
Oh wow 🚀 didn't see your last message. If you do encounter issues, please let me know, and I will come back to this! |
Dear SIMBA creator.
Thank you for your work on SIMBA.
I have a big project with more than 1000 videos acquired in standardized conditions (open field).
I leave the GUI and I work on jupyter notebook to process my data.
As far everything works well, however I am puzzled for ROI creation.
Indeed, in some videos, the camera was tilted and some objects were not placed consistently at the same place.
So I'd like to draw my ROIs on to one video and then open recursively each video to move/replace/resize ROIs to make an accurate quantification.
As a strating point I tried on a Jupyter-Notebook to use ROI_define and path both config_path and video_path but :
"""
In [26]: config_path = '/home2/Projet_NAOMI/Behavorial_Analysis/01-SIMBA/NAOMI/p
...: roject_folder/project_config.ini'
In [27]: video_path = "/home2/Projet_NAOMI/Behavorial_Analysis/00-RawData/02-Vid
...: eos/"
In [28]: ROI_define(config_path,video_path)
TypeError Traceback (most recent call last)
in
----> 1 ROI_define(config_path,video_path)
TypeError: 'module' object is not callable
And I tried as I found on website :
In [29]: _ = ROI_define(config_path,video_path)
TypeError Traceback (most recent call last)
in
----> 1 _ = ROI_define(config_path,video_path)
TypeError: 'module' object is not callable
"""
If it's not a huge job for you could you give me an example of function or at least a path to write my function to :
1/ open the ROI Gui to draw ROIs on the first video found,
2/ save ROIs in a specific place
3/ Load second video and previous ROIs for correction,
4/ save ROIs in a specific place
etc...
Thank you so much
The text was updated successfully, but these errors were encountered: