joeVenner / control-3d-character-using-python

Controlling 3D character's Face Movements using OpenCV and pyhton
MIT License
163 stars 47 forks source link

Python Script and Capture Motion Failures Need Your Help #1

Closed markchang2006 closed 4 years ago

markchang2006 commented 4 years ago

Thank you so much for your amazing job and detailed tutorial on Youtube!

I follow every steps carefully whilst unfortunately met some issues need your kind help if possible. Thanks very much in advance!

  1. The first issue is "Python script failed" when running OpenCVAnim.py, please find the attached jpg files for details. ErrorMessage_info_Running_OpenCVAnim_py ErrorMessage_System_Console_RunningOpenCAMnim_py

There is no further error message when running OpenCVAnimOperator.py,

NoError_info_Running_OpenCVAnimOperator_py N0Error_System_Console_Running_OpenCVAnimOperator_py

  1. The second issue occurred when the "capture" button is clicked, the screen shots are shown as the attached jpg files below: ReportError_After_Clicking_Capture_Button ErrorMessage_Info_after-Clicking_Capture_Button ErrorMessage_System_After_Clicking_Catture_Button

One question: if I use the build-in webcam on my laptop, is the setting of "cv2" in the file "OpenCVAnimOperator.py" needs to be modified? {lease advise. Thanks!

I think it's better for you to figure the possible root causes out if the Vincent.blend file is attached here: Vincent.zip

and the paths on my Laptop are listed below for your information: D:\Blender_Practice\MotionCapture\GSOC2017-master D:\Blender_Practice\MotionCapture\control-3d-character-using-python-master

Laptop System information: Intel i7-8750H CPU@2.20GHz 32GB DRAM Win-10 Ver.2004 Nvidia GTX 1050Ti USB2.0 UVC WebCam (Build-in on laptop Screen)

Please feel free to let me know should you need any more information. Thanks so much for your talented help in advance!

joeVenner commented 4 years ago

Hi sir, first i am vary happy to hear that and ill help you until you find the solution

  1. Please set the full path of the model in the OpenCVAnimOperator.py Line 40: landmark_model_path = "D:\\Blender_Practice\\MotionCapture\\GSOC2017-master\\data\\lbfmodel.yaml"

  2. about the built-in webcam : per default i put the ID of the built in one but if you wan to use your second webcam you should change the ID in the line 210 and change the 0 to 1 in self._cap = cv2.VideoCapture(0)

  3. Please Download the test.py file HERE this file only to check if the model and the webcam are working fine
    put it in this path D:\Blender_Practice\MotionCapture\control-3d-character-using-python-master it will help you out to figure if the model and the webcam are working fine
    [-] if there is a problem with the test.py file please let me know [+] if the test.py works fine so you can just go to the OpenCVAnimOperator.py and change the model path then also don't forget to check the cam id in the line 210 and change the 0 to 1 if you want to use you 2nd webcam

    PLEASE DON'T HESITATE TO CONTACT ME IF YOU FACED ANY FURTHER PROBLEMS

    python with joe support

markchang2006 commented 4 years ago

Hi! Joe,

I'm so touched for your prompt response with so much details!

In response to the actions list above. I'm trying the best to report to you as detailed as possible, hopefully it will help more people who is interested whist suffered from similar issues :

  1. The full path of the model in the OpenCVAnimOperator.py Line 40 has already been set as: landmark_model_path = "D:\Blender_Practice\MotionCapture\GSOC2017-master\data\lbfmodel.yaml" so as to correspond to my file directory situation.

  2. I've tried to run script Test.py in Vincent.blend file twice: The first time was run with self._cap = cv2.VideoCapture(0) in the line 210 of OpenCVAnimOperator.py The error message on system console is shown below: ErrorMessage_SystemConsole_Afer_Running_Test_py

and here comes my question: is Visual Studio 2017 needed? mine is vs2019 currently. Questions_About_ErrorMessage_SystemConsole_Afer_Running_Test_py

The second time I ran Test.py in Vincent.blend file with self._cap = cv2.VideoCapture(1) in the line 210 of OpenCVAnimOperator.py
Then, the error message on system console  is somehow different as shown below:

ErrorMessage_SystemConsole_Afer_2nd_Time_Running_Test_py

As both trial indicate warnings about c::\Project\opencv-python......, but actually I don't have such folder on my laptop, therefore, I have no idea what are the possible root causes.

  1. I've downloaded the Test.py file and put in the path you instructed as shown in the zip file below for your information. control-3d-character-using-python-master.zip

  2. The Test.py gets no problem when I change the "_cap.set(cv.CAP_PROP_FRAME_WIDTH, 640)" and "_cap.set(cv.CAP_PROP_FRAME_HEIGHT, 480)" in the lines 8 & 9 respective from both original settings "512" and "512", and ran Test.py in Vincent.blend file with self._cap = cv2.VideoCapture(1) in the line 210 of OpenCVAnimOperator.py

So, my temporary thought is that the issues shown above is nothing to do with Visual Studio 2017.

  1. Currently the problem I have is, every time, when I open Vincent.blender file, it runs the Test.py first. It results in the issue that any action cannot be run further in the Vincent.blender file, except execution of Test.py. The only way I can stop Test.py is pressing [esc] key on keyboard, but it will close Vincent.blender file simultaneously. Please help when you're available, thanks a lot in advance!

Halt_Vincent_Blender_File Halt_Vincent_Blender_File_1

markchang2006 commented 4 years ago

Hi Joe,

Good news, it's solved.

I've redone the whole procedure again, the only differences are listed below for your information:

  1. CMD with right click first and select the administrator option, then executed those 2 commands.

  2. On Vincent.blender file, I ran OpenCVAnimOperator.py first instead of the other one.

I'm very appreciated with your prompt response and kind support. Thank you very much!

joeVenner commented 4 years ago

Hi mark I am very happy to hear that you found the solution Please mark the issue as solved let me know if you have any future problems Best regards joe

markchang2006 commented 4 years ago

Hi Joe,

I'm wondering if there is anyway to save the actions of Vincent model when it follow the actions captured by camera through OpenCV software?

I've tried several days to figure it out, however I'm still not aware of anything about it.

Please advise if you know any solution about it. Thanks a lot in advance!

Best Regards, 築韻空間美學工坊 張世忠(Mark Chang) 0939-061556 竹北市福興路1028巷1號(來訪時請先預約,以免向隅.感恩!) https://www.twdreamspace.com/

JoeVenner notifications@github.com 於 2020年8月7日 週五 上午4:01寫道:

Hi mark I am very happy to hear that you found the solution Please let me know if you have any future problems Best regards joe

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeVenner/control-3d-character-using-python/issues/1#issuecomment-670163393, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUZQ7RXD2O5X6LC24IMPKDR7MDYBANCNFSM4PVZFZFA .

joeVenner commented 4 years ago

Hi , yes you can do it

markchang2006 commented 4 years ago

Hi, Joe,

Would you please let me know how to do it? Thanks!

Best Regards, 築韻空間美學工坊 張世忠(Mark Chang) 0939-061556 竹北市福興路1028巷1號(來訪時請先預約,以免向隅.感恩!) https://www.twdreamspace.com/

JoeVenner notifications@github.com 於 2020年8月9日 週日 上午4:03寫道:

Hi , yes you can do it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeVenner/control-3d-character-using-python/issues/1#issuecomment-670968418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUZQ7X6HP4X5TXBX2KBVVLR7WVQPANCNFSM4PVZFZFA .

joeVenner commented 4 years ago

Hi sir, Yes for sure, you can just look for record blender animation https://bit.ly/2CqHbn2

joeVenner commented 4 years ago

Can You Please Set the Issue as Solved ! PLEASE DON'T HESITATE TO CONTACT ME IF YOU FACED ANY FURTHER PROBLEMS

python with joe support

markchang2006 commented 4 years ago

Dear Joe,

Thanks for your kind attention! I think you have given solutions to me, however as I've just engaged into a tough project these days, I'll response to you in the coming future once the urgent project is done. Thanks!

Best Regards, 築韻空間美學工坊 張世忠(Mark Chang) 0939-061556 竹北市福興路1028巷1號(來訪時請先預約,以免向隅.感恩!) https://www.twdreamspace.com/

JoeVenner notifications@github.com 於 2020年8月18日 週二 下午9:30寫道:

Can You Please Set the Issue as Solved ! PLEASE DON'T HESITATE TO CONTACT ME IF YOU FACED ANY FURTHER PROBLEMS

python with joe support

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeVenner/control-3d-character-using-python/issues/1#issuecomment-675479765, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUZQ7R5UTSTPT2DOGCN7GLSBJ67JANCNFSM4PVZFZFA .