ArtLabss / tennis-tracking

Open-source Monocular Python HawkEye for Tennis
https://www.artlabs.tech
The Unlicense
392 stars 95 forks source link

-215:Assertion failed) count > 0 in function 'fitLine2D_wods' #7

Closed SaiThejeshwar closed 2 years ago

SaiThejeshwar commented 2 years ago

Hi,

First of all, this is great work!

This is the error I get when I am trying to run on a tennis video. After printing model summary, this follows.

BOXES [] BOXES [] BOXES [array([166.0948 , 679.272 , 195.11845, 705.8905 ], dtype=float32)] BIGGEST [166. 679. 195. 706.] CAMERA ... Court tracking failed, adding 5 pixels to dist CAMERA ... Court tracking failed, adding 5 pixels to dist CAMERA ... Court tracking failed, adding 5 pixels to dist Traceback (most recent call last): File "predict_video.py", line 113, in lines = court_detector.track_court(frame) File "/content/drive/My Drive/TennisTracking/NewTracking/tennis-tracking/court_detector.py", line 445, in track_court return self.track_court(frame) File "/content/drive/My Drive/TennisTracking/NewTracking/tennis-tracking/court_detector.py", line 445, in track_court return self.track_court(frame) File "/content/drive/My Drive/TennisTracking/NewTracking/tennis-tracking/court_detector.py", line 445, in track_court return self.track_court(frame) File "/content/drive/My Drive/TennisTracking/NewTracking/tennis-tracking/court_detector.py", line 421, in track_court [vx, vy, x, y] = cv2.fitLine(new_points, cv2.DIST_L2, 0, 0.01, 0.01) cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/linefit.cpp:50: error: (-215:Assertion failed) count > 0 in function 'fitLine2D_wods'

shukkkur commented 2 years ago

@SaiThejeshwar Thanks for opening the issue! Can I see what video you are trying to run the project on?

SaiThejeshwar commented 2 years ago

This is the video I am trying to run on https://www.youtube.com/watch?v=CGRzfUccmNE&ab_channel=Wimbledon

shukkkur commented 2 years ago

This project expects a video (preferably not so long) of the game itself (no commercials, spectators, breaks). Just like the sample video inputs are. Try trimming that video and passing a single rally to the algorithm. image Have to work. Anyway, try video with other court colors as well.

shukkkur commented 2 years ago

Hi @SaiThejeshwar . Were you able to successfully run the code or still facing any errors?

SaiThejeshwar commented 2 years ago

Hi @shukkkur . I have trimmed the video to just 2 mins, but looks like there is one logo in between the video. So same error. Will try to trim it and update the results.