pageauc / speed-camera

A Unix, Windows, Raspberry Pi Object Speed Camera using python, opencv, video streaming, motion tracking. Includes a Standalone Web Server Interface, Image Search using opencv template match and a whiptail Admin Menu Interface Includes picam and webcam Plugins for motion track security camera configuration including rclone sync script. watch-app allows remotely controller camera configuration from a remote storage service name. Uses sqlite3 and gnuplot for reporting. Recently added openalpr license plate reader support.
Apache License 2.0
987 stars 173 forks source link

makehtml.py IndexError: list index out of range #70

Closed anthonymobile closed 3 years ago

anthonymobile commented 3 years ago

it seems that that make_web_page(cur_link, next_row, next_link) on line 190 is always feeding an empty next_row to the make_web_page function but i cant figure out why

/home/pi/speed-camera/makehtml.py ver 6.70 - written by Claude Pageau
Processed 5 web pages in 0 seconds into Folder /home/pi/speed-camera/media/html
Done ...
Traceback (most recent call last):
  File "./makehtml.py", line 201, in <module>
    read_from_csv(source_csv)
  File "./makehtml.py", line 190, in read_from_csv
    make_web_page(cur_link, next_row, next_link)
  File "./makehtml.py", line 40, in make_web_page
    YYYYMMDD=row_data[0]
IndexError: list index out of range

######################################
#          Review Output             #
######################################
  Press Enter to Return to Main Menu
anthonymobile commented 3 years ago

looks like the position of fields changed. i am working on a PR

anthonymobile commented 3 years ago

fixed https://github.com/pageauc/speed-camera/pull/71 and https://github.com/pageauc/speed-camera/pull/72

sorry, i am not a github pro.

pageauc commented 3 years ago

Thanks Anthony. Greatly Appreciated. This was due to changing csv and sqlite schema to make one datetime field and eliminate hour and minute

Claude ..

On Mon, Mar 1, 2021 at 7:48 PM Anthony Townsend notifications@github.com wrote:

it seems that that make_web_page(cur_link, next_row, next_link) on line 191 is always feeding an empty next_row to the make_web_page function but i cant figure out why

/home/pi/speed-camera/makehtml.py ver 6.70 - written by Claude Pageau Processed 5 web pages in 0 seconds into Folder /home/pi/speed-camera/media/html Done ... Traceback (most recent call last): File "./makehtml.py", line 201, in read_from_csv(source_csv) File "./makehtml.py", line 190, in read_from_csv make_web_page(cur_link, next_row, next_link) File "./makehtml.py", line 40, in make_web_page YYYYMMDD=row_data[0] IndexError: list index out of range

######################################

Review Output

###################################### Press Enter to Return to Main Menu

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/70, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZC5VKWYWAXXNWS4XKDTBQYXFANCNFSM4YNVKJWA .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

anthonymobile commented 3 years ago

n.b. i think there is still one error in the area computation. i can fix it later.

On Tue, Mar 2, 2021 at 8:01 AM Claude Pageau notifications@github.com wrote:

Thanks Anthony. Greatly Appreciated. This was due to changing csv and sqlite schema to make one datetime field and eliminate hour and minute

Claude ..

On Mon, Mar 1, 2021 at 7:48 PM Anthony Townsend notifications@github.com wrote:

it seems that that make_web_page(cur_link, next_row, next_link) on line 191 is always feeding an empty next_row to the make_web_page function but i cant figure out why

/home/pi/speed-camera/makehtml.py ver 6.70 - written by Claude Pageau Processed 5 web pages in 0 seconds into Folder /home/pi/speed-camera/media/html Done ... Traceback (most recent call last): File "./makehtml.py", line 201, in read_from_csv(source_csv) File "./makehtml.py", line 190, in read_from_csv make_web_page(cur_link, next_row, next_link) File "./makehtml.py", line 40, in make_web_page YYYYMMDD=row_data[0] IndexError: list index out of range

######################################

Review Output

###################################### Press Enter to Return to Main Menu

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/70, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABNPKZC5VKWYWAXXNWS4XKDTBQYXFANCNFSM4YNVKJWA

.

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_pageauc_speed-2Dcamera_issues_70-23issuecomment-2D788891587&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=8fRMZ2-poJo6lcN2cIBY9g&m=IpC7yWxzM3OzrlrerHYJy_0-Sn4B8PNLGO1J4n0HSlw&s=lB_yZBxiAlS2XCak4Krn7uUsVvTuYJGoFN8yFnUVALE&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAA5YY2XLDM2E6I5O6H6EI3TBTOSRANCNFSM4YNVKJWA&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=8fRMZ2-poJo6lcN2cIBY9g&m=IpC7yWxzM3OzrlrerHYJy_0-Sn4B8PNLGO1J4n0HSlw&s=eKdots5XfOW-AOUJIqSHTQg8TIHCHZmNgd5jgeKZeVs&e= .

pageauc commented 3 years ago

Must be your data. I ran it with no problems on a fresh install. You should do an upgrade Stop speed camera. Clear speed-cam.csv file (rename or delete) Clear all items in media/recent, (these are symlinks) and backup media/images to another location so images folder is empty. and make a fresh start. Should also clear (rename or delete) data/speed_cam.db

Start speed camera and Collect new images and data and retry running makehtml.py I ran under python 2 and 3 without problem. You should also run sql_speed_gt.py to test graphing data. View graphs in browser under reports folder on web page You can also pass it a speed parameter to avoid being prompted. I usually run at 20 km to avoid bikes and other slow objects. I plan on adding days to query eg past days from now. eg past 7 days, Etc. This would also be a parameter. This could be run from a cron job to automate. I am thinking of changing from Gnuplot to MatLab for plotting graphs.

Let me know how you make out

Let me know if clearing your data works. I have had no problems in my testing.

Regards Claude ....

On Wed, Mar 3, 2021 at 11:44 AM Anthony Townsend notifications@github.com wrote:

Closed #70 https://github.com/pageauc/speed-camera/issues/70.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/70#event-4403092827, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZCMEACZVOUF6YMGH6TTBZRQDANCNFSM4YNVKJWA .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

anthonymobile commented 3 years ago

not sure what we are talking about—my errors happened before i submitted the pull requests updating how makehtml.py parses the new row format in speed-cam.csv, which you accepted. my last comment was about one update i overlooked with was how the area computation was done (computed now, vs fetched from the row). i think you also accepted that PR. so this is all good. re-closing.

pageauc commented 3 years ago

Ok Sound like everything is good with you as well. Thanks for your update. Thanks for your contribution to the project. Your help is appreciated Claude ...

On Wed, Mar 3, 2021 at 1:51 PM Anthony Townsend notifications@github.com wrote:

Closed #70 https://github.com/pageauc/speed-camera/issues/70.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/70#event-4403745206, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZEQYZ6GZJP5FCOYVPTTB2AKZANCNFSM4YNVKJWA .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc