Code Monkey home page Code Monkey logo

Comments (8)

Michaelhess17 avatar Michaelhess17 commented on August 26, 2024

Hi there!
I'm having an issue with Batch Processing, as well. I have the most up-to-date version of conda, and just tried installing FaceMap both through creating a new conda environment as described in the README and through pip install/pip --upgrade in another new environment, and neither way is working. I should mention that I ran into a Pip error during the conda installation (and subsequently had errors that said WARNING: Ignoring invalid distribution ~yqt5-sip (though pyqt5 did get installed). After these errors occurred I went through the environment.yml file and installed all the packages either through pip or conda as described in the .yml file.

There are separate problems I'm experiencing depending on the installation method, so I'll describe them both.

When installing with pip, it seems that it is not saving the selected ROIs in the output folder when that button is pressed, and then when loading multiple videos the Batch Process button remains grey.
When using the save ROIs button, here is the error shown in the command window:

Error reading frame
Traceback (most recent call last):
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 501, in go_to_frame
self.jump_to_frame()
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 533, in jump_to_frame
self.next_frame()
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 565, in next_frame
self.imgs[i][:,:,:,2] = im[i]
IndexError: list index out of range
Y:/Jui-Yen Huang/Derived Files/Data/In vivo Calcium Imaging/20210516_0528_jRGECO1a_FGFR-tri-Ncre64-2/20210516_jRGECO1a_FGFR-tri-Ncre64-2_P11/Behavior
Traceback (most recent call last):
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 637, in save_ROIs
'filenames': self.filenames, 'iframes': self.iframes}
AttributeError: 'MainW' object has no attribute 'iframes'
Y:/Jui-Yen Huang/Derived Files/Data/In vivo Calcium Imaging/20210516_0528_jRGECO1a_FGFR-tri-Ncre64-2/20210516_jRGECO1a_FGFR-tri-Ncre64-2_P11/Behavior
Traceback (most recent call last):
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 637, in save_ROIs
'filenames': self.filenames, 'iframes': self.iframes}
AttributeError: 'MainW' object has no attribute 'iframes'
Y:/Jui-Yen Huang/Derived Files/Data/In vivo Calcium Imaging/20210516_0528_jRGECO1a_FGFR-tri-Ncre64-2/20210516_jRGECO1a_FGFR-tri-Ncre64-2_P11/Behavior
Traceback (most recent call last):
File "C:\Users\Micha\Anaconda3\envs\Lu Lab\lib\site-packages\facemap\gui.py", line 637, in save_ROIs
'filenames': self.filenames, 'iframes': self.iframes}
AttributeError: 'MainW' object has no attribute 'iframes'

When installing with conda, the Batch Process button is available, and I am able to save the ROIs, but then pressing the Batch Process button first causes an OpenCV error and then either crashes the application or makes following attempts not work either. Here is the OpenCV error I am getting:

[ERROR:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-obtuy4a_\opencv\modules\videoio\src\cap.cpp (162) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-obtuy4a_\opencv\modules\videoio\src\cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'cv::icvExtractPattern'
QGraphicsScene::removeItem: item 0x1b7c074b0b0's scene (0x0) is different from this scene (0x1b7c0e3b1b0)
Traceback (most recent call last):
File "C:\Users\Micha\FaceMap\facemap\menus.py", line 17, in
openFolder.triggered.connect(lambda: io.open_folder(parent))
File "C:\Users\Micha\FaceMap\facemap\io.py", line 37, in open_folder
load_movies(parent)
File "C:\Users\Micha\FaceMap\facemap\io.py", line 251, in load_movies
parent.jump_to_frame()
File "C:\Users\Micha\FaceMap\facemap\gui.py", line 747, in jump_to_frame
self.imgs[i][:,:,:,1] = self.img[i].copy()
ValueError: could not broadcast input array from shape (1080,1920,3) into shape (0,0,3)

Do you know what I can do to get the Batch Processing working?

Thanks for the help and for making all these awesome packages!!
-- Michael

from facemap.

Atika-Syeda avatar Atika-Syeda commented on August 26, 2024

Hello @Michaelhess17,

Please pull recent changes from the main branch (using the instructions below) to avoid "AttributeError: 'MainW' object has no attribute 'iframes'"

git clone https://github.com/MouseLand/facemap.git
Remove old conda environment for facemap and follow steps 1-5 for using the updated environment.yml file.

For batch processing, please follow the instructions after cloning the updated version. The opencv error seems to indicate some issue with loading video so make sure you are able to load the video and 'process ROIs' before proceeding with 'process batch'.

from facemap.

Atika-Syeda avatar Atika-Syeda commented on August 26, 2024

Hello @dgbarson,

Are you trying batch processing of multiple ROIs from multiple videos taken simultaneously?
If your files are overwritten, I'd recommend storing file1.avi, file2.avi.. in separate folders and then use batch process for the different sets of ROIs independently.

from facemap.

Michaelhess17 avatar Michaelhess17 commented on August 26, 2024

Hey again!
I tried installing Facemap by creating a Conda environment with the GitHub environment.yml on a couple of machines (one with an outdated version of Conda, and one that's up-to-date) and I am still receiving the same error ("AttributeError: 'MainW' object has no attribute 'iframes'"), unfortunately!

Do you know anything else we might try?

Thanks again!

from facemap.

Atika-Syeda avatar Atika-Syeda commented on August 26, 2024

Hi @Michaelhess17, the error tells me that your version of the code is different from the main branch. You can confirm that by searching for 'iframes' variable in your code and check against the relevant file and line number on the main branch. Hence, you will have to make sure your code is the same as main branch to avoid the error.

from facemap.

Atika-Syeda avatar Atika-Syeda commented on August 26, 2024

from facemap.

Atika-Syeda avatar Atika-Syeda commented on August 26, 2024

from facemap.

Michaelhess17 avatar Michaelhess17 commented on August 26, 2024

Thank you so much! As far as I can tell, this is working now!

from facemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.