allenye66 / Computer-Vision-Lip-Reading-2.0

A speech recognition system using 3D CNNs. The final model achieves 97.4% training accuracy and a 99.2% testing accuracy and the system can accurately recognize spoken words from a set of pre-defined words in real-time.
22 stars 8 forks source link

ImportError: cannot import name 'TOTAL_FRAMES' from 'constants' (C:\Users\Hari\AppData\Local\Programs\Python\Python310\lib\site-packages\constants-2023.2.0-py3.10.egg\constants.py) #2

Open Ayushdcd opened 6 months ago

Ayushdcd commented 6 months ago

Traceback (most recent call last): File "C:\Users\Hari\Desktop\Desktop\Computer-Vision-Lip-Reading-2.0\demo\predict_live.py", line 16, in from constants import TOTAL_FRAMES, VALID_WORD_THRESHOLD, NOT_TALKING_THRESHOLD, PAST_BUFFER_SIZE, LIP_WIDTH, LIP_HEIGHT ImportError: cannot import name 'TOTAL_FRAMES' from 'constants' (C:\Users\Hari\AppData\Local\Programs\Python\Python310\lib\site-packages\constants-2023.2.0-py3.10.egg\constants.py)

Anyone help i have already installed constants using pip, still showing this error

possbility commented 4 months ago

You can directly copy the relevant values ​​in "consitants.py" to "predict_live.py" without the need for import operations. 1

TimeToFlip commented 4 months ago

sorry to hijack this, but i couldn't post an issue for whatever reason, here's what i wanted to post: when i collect my own data using collect.py, i go to 3DCNN.ipynb to train new data and get new weights for my use, but i see that when i print the classes they will be all the same like this:(a 680 counts), and this way i can't train the network i think.

i also ignored this because it doesn't work, but i don't think it has any effect on the code: gc.collect() !cat /proc/meminfo | grep Mem

anyway to fix this? maybe a problem with the way labels are collected or how they are classed, im not sure.

can you help @possbility? you seem to have this code working.

possbility commented 4 months ago

image "a 680 counts"that means the data(by"collect.py") is not named in the correct way,I guess it's probably because all the data you collected is saved under the label "a",When you use the "collect.py" file, you must collect the data under the corresponding label, just like when you select the label "a" when running, you can only say "a" but not other words until the collection is completed. , if you want to say other corresponding words, you must re-run "collect.py" and select the correct tags and enter them, and repeat until all collections are completed.Now if you want to solve this problem, it is best to delete the previously collected data, re-collect the above data, or rename their file names under the corresponding collected data (but I think this is very time-consuming and has a high probability An error will occur) As marked in the program above, the "data.txt" it detects comes from the path where "collect.py" is collected and saved. You can check whether all the collected data in this file is "a_x" ( x is a specific number), if this is indeed the case, you can do as I said above, which should solve your problem. As for "gc.collect() !cat /proc/meminfo | grep Mem" It is just a manual memory cleaner. You'd better add it to ensure that your computer has enough running memory for model training, if your computer has a lot of running memory. You can ignore them.