Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Scripts for daily image collection and decryption. #26

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

ZPBerg
Copy link
Contributor

@ZPBerg ZPBerg commented Aug 12, 2020

decrypt_images is not ready to merge yet, I just wanted to make the PR now to get feedback on collect_images. I'll finish decrypt_images once @jbagnara finishes encryption in main.py, then merge this PR.

After running main.py to send some images to ee220clnx1:/local/b/embedvis/Nano_Images,
I tested collect_images on the machine by cloning my version of the repo to that location.

I changed the database query to a different date from today for testing, but other than that the code was exactly the same and I successfully copied images and a metadata.json to the Drive.

ZPBerg and others added 30 commits July 2, 2020 14:25
* Added evaluator for detector and classifier

* Made necessary changes to main to run evaluator

* detector_type as an argument, compare to list of strings

* Retinaface works with GPU

Co-authored-by: Aditya Chakraborty <chakra17@purdue.edu>
Co-authored-by: Aditya Chakraborty <31283807+adityachakra16@users.noreply.github.com>
* Added evaluator for detector and classifier

* Made necessary changes to main to run evaluator

* detector_type as an argument, compare to list of strings

* Retinaface works with GPU

Co-authored-by: Aditya Chakraborty <chakra17@purdue.edu>
Co-authored-by: Aditya Chakraborty <31283807+adityachakra16@users.noreply.github.com>
@ZPBerg ZPBerg requested a review from stephend017 August 12, 2020 23:14

METADATA_FILE = 'metadata.json'
# rclone on ee220clnx1 is an earlier version that doesn't support copying to shared folders
RCLONE_PATH = '/home/shay/a/bergz/rclone-v1.52.2-linux-amd64/rclone'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if this should be an argument or not, but there's no reason it would ever change. I made this executable able to be executed by anyone on the machine, so this script could be run by anyone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lets make it an argument with a default value.


for (image_name, x_min, y_min, x_max, y_max, init_vector, goggles) in cursor:
metadata.append({'image_name': image_name,
'x_min': float(x_min), # JSON cannot serialize Decimals.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine for converting a decimal to float.

METADATA_FILE = 'metadata.json'
# rclone on ee220clnx1 is an earlier version that doesn't support copying to shared folders
RCLONE_PATH = '/home/shay/a/bergz/rclone-v1.52.2-linux-amd64/rclone'
TODAY = datetime.datetime.today().strftime('%Y-%m-%d')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dates usually need to be calculated in the function they are called in. However I understand that this is a simple script which probably doesn't run for a very long period of time. If that is the case, please leave a comment denoting that so this doesn't become a future hidden bug.

@ZPBerg
Copy link
Contributor Author

ZPBerg commented Aug 13, 2020

Because the rclone executable was in my personal folder, others couldn't run it. I put a version at /local/b/embedvis that anyone can run, but each user has to set up their own configuration pointing to the Drive (or wherever else they want they images sent).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants