avishah3 / AI-Basketball-Shot-Detection-Tracker

Machine learning and computer vision to detect and analyze basketball shots in real-time (2023)
142 stars 20 forks source link

IndexError in shot_detector.py #2

Open andiWtt opened 6 months ago

andiWtt commented 6 months ago

Hi,nice project. I have trained the model and run shot-detector.py,it works well at beginning, successfully detect person, but did not have boxes for basketball and hoop then video shut down in few seconds and report below: File "/Users/wangenda/AI-basketball-analysis/AI-Basketball-Shot-Detection-Tracker-master/shot_detector.py", line 153, in ShotDetector() File "/Users/wangenda/AI-basketball-analysis/AI-Basketball-Shot-Detection-Tracker-master/shot_detector.py", line 44, in init self.run() File "/Users/wangenda/AI-basketball-analysis/AI-Basketball-Shot-Detection-Tracker-master/shot_detector.py", line 69, in run current_class = self.class_names[cls]


IndexError: list index out of range
Any suggestions will be helpful,thanks a lot.
SAWRJJ commented 3 months ago

You need to change the self.class_names part as your classes.

andiWtt commented 3 weeks ago

thanks a lot