From 01e9656e5c26077af4a85e42b94a86aded57b4ce Mon Sep 17 00:00:00 2001 From: Oscar Pocock Date: Sat, 28 May 2022 16:34:46 +0100 Subject: [PATCH] Final project demo files --- docs/project-demo/demo-material/demo.md | 2 +- docs/project-demo/demo-material/helper-functions.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/project-demo/demo-material/demo.md b/docs/project-demo/demo-material/demo.md index a0728f9..a0cb9d0 100644 --- a/docs/project-demo/demo-material/demo.md +++ b/docs/project-demo/demo-material/demo.md @@ -17,7 +17,7 @@ Explain: why frames are exported seperate to images 3. Show a successful run Run: python src/autophotographer/autophotographer_main.py -i /datasets/Hannah/overcastjuly/melindwr1/* -Explain: ouput from command +Explain: output from command 4. Discuss filters - Brightness (Upper and lower bounds) diff --git a/docs/project-demo/demo-material/helper-functions.py b/docs/project-demo/demo-material/helper-functions.py index e67e16e..f37c90f 100644 --- a/docs/project-demo/demo-material/helper-functions.py +++ b/docs/project-demo/demo-material/helper-functions.py @@ -8,6 +8,7 @@ import numpy as np import random from PIL import Image import requests +import json # Export's video frames def video_to_frames(path): @@ -119,4 +120,10 @@ def URL2FFT(url): image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) else: image = PILToNumpy(image) - showDiscreteFFT(image) \ No newline at end of file + showDiscreteFFT(image) + +def fileToList(path): + with open(path) as f: + contents = f.read().rstrip() + paths = contents.strip('][').replace("'", "").split(', ') + return paths \ No newline at end of file