uncg-daisy / pywebcat Goto Github PK
View Code? Open in Web Editor NEWPython tool for working with the NOAA NOS Web Camera Applications Testbed (WebCAT)
License: MIT License
Python tool for working with the NOAA NOS Web Camera Applications Testbed (WebCAT)
License: MIT License
data releases will have the tags + the csv'ed metadata (from wc.save_frames
).
we might want to have a way to grab frames directly from metadata record (i.e., for rehydrating the tagged data release)
URLs do not generate correcly for single digit months, days and times. we need a leading 0 in these cases.
Example with months. In this example i use the CLI and provide a month of 09
( 9
gives the same behavior):
evanbgoldstein$ pywebcat -dir /Users/evanbgoldstein/Downloads/WebCAT -s buxtoncoastalcam -y 2018 -m 09 -d 12 -t 1000 -i 20 -v
OpenCV: Couldn't read video stream from file "http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_12/buxtoncoastalcam.2018-9-12_1000.mp4"
Warning: http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_12/buxtoncoastalcam.2018-9-('buxtoncoastalcam', 2018, 9, 12, 1000)_1000.mp4 not a valid url... Skipping.
This URL works:
http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_09/2018_09_12/buxtoncoastalcam.2018-09-12_1000.mp4
this is also true for days 01-09:
~ evanbgoldstein$ pywebcat -dir /Users/evanbgoldstein/Downloads/WebCAT -s buxtoncoastalcam -y 2018 -m 09 -d 01 -t 1000 -i 20 -v
OpenCV: Couldn't read video stream from file "http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_1/buxtoncoastalcam.2018-9-1_1000.mp4"
Warning: http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_1/buxtoncoastalcam.2018-9-('buxtoncoastalcam', 2018, 9, 1, 1000)_1000.mp4 not a valid url... Skipping.
working URL:
http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_09/2018_09_01/buxtoncoastalcam.2018-09-01_1000.mp4
and times (0800):
:~ evanbgoldstein$ pywebcat -dir /Users/evanbgoldstein/Downloads/WebCAT -s buxtoncoastalcam -y 2018 -m 09 -d 01 -t 0800 -i 20 -v
OpenCV: Couldn't read video stream from file "http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_1/buxtoncoastalcam.2018-9-1_800.mp4"
Warning: http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_9/2018_9_1/buxtoncoastalcam.2018-9-('buxtoncoastalcam', 2018, 9, 1, 800)_800.mp4 not a valid url... Skipping.
working URL:
http://webcat-video.axds.co/buxtoncoastalcam/raw/2018/2018_09/2018_09_01/buxtoncoastalcam.2018-09-01_0800.mp4
Move webcat utils to Tom's page,
move Tiny Collision to DAISY
-Coastal Station/
|-Time XXX/
|- metadata.csv
|- jpgs/
|-frame 0.jpg
|-frame 10.jpg
|....
|- Time YYY/
|- Time ZZZ/
|....
@ebgoldstein I uploaded a notebook demonstrating a simple pseudo-labelling workflow (note that it draws from a "data" directory but I haven't uploaded the labelled images used to train a classifier because I wasn't sure of they had a DOI yet or not?).
We could turn this into a function/class/script to formalise it if we want to go down this path further.
At the moment, webcat utils acts as a standalone module. It would be possible to package it up into an easy-to-install pip install webcat_utils
.
However, as far as I'm aware, the only way to use the CLI aspect of webcat_utils without having to call the absolute path of the file on a local machine ($python path/webcat_utils.py
) is to add it to $PATH, which can be done using setup.py. But I'm not sure how I feel about this, need to think more on it...
I think the 'notebooks/FindEvents.ipynb and 'notebooks/WebCAT_Retriever.ipynb
can be deleted. the event nb is not critical to this package — is that ok w/ you @TomasBeuzen ?
Collision and non-collision
How I bundle up the requirements depends in some part on whether this becomes a package or not (see #12). Leaving this issue open for now as a reminder.
If you run webcat_utils more than once for the same station+datetime but with a different "save frame interval", the existing .csv metadata will be overwritten, but the existing .jpg frames will not be. We have two options:
Ok, @TomasBeuzen so i looked over webcat_utils
and had a think —
For this project, we might want a single method that does it all..
Inputs:
.csv
Outputs:
jpgs
.csv
with some infothe method would do this:
vr.download_url
does this)jpegs
(vr.save_frames
does this)csv
that has:
I enabled the Zenodo webhook, so when we decide on #17 and #9 we should:
This is also somewhat related to #12 but testing of functionality with pytest and code coverage need to be improved. I might also implement some GitHub actions for automating this, as well as black formatting.
code needs to create WebCAT urls to download user-defined times and store in a directory structure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.