diff --git a/1_convert_videos/video_mp4_converter.py b/1_convert_videos/video_mp4_converter.py index 4975564..cb1e695 100644 --- a/1_convert_videos/video_mp4_converter.py +++ b/1_convert_videos/video_mp4_converter.py @@ -68,7 +68,7 @@ def main(): args = parser.parse_args() if not os.path.exists(args.input): - print("Input directory does not exist.") + print(f"Warning: The specified input directory '{args.input}' does not exist. Please check the path and try again.") return if not os.path.exists(args.output): os.makedirs(args.output) diff --git a/1_convert_videos/video_mp4_converter.yaml b/1_convert_videos/video_mp4_converter.yaml index 170dd06..defb6d3 100644 --- a/1_convert_videos/video_mp4_converter.yaml +++ b/1_convert_videos/video_mp4_converter.yaml @@ -6,7 +6,7 @@ input: repo: raw_videos_and_images glob: "/*" transform: - image: lbliii/video_mp4_converter:1.0.14 + image: lbliii/video_mp4_converter:1.0.16 cmd: - python3 - /video_mp4_converter.py @@ -17,4 +17,4 @@ transform: autoscaling: true -# docker buildx build --platform linux/amd64 -t lbliii/video_mp4_converter:1.0.14 --push . \ No newline at end of file +# docker buildx build --platform linux/amd64 -t lbliii/video_mp4_converter:1.0.16 --push . \ No newline at end of file diff --git a/2_flatten_images/image_flattener.py b/2_flatten_images/image_flattener.py index a22bba0..29b706a 100755 --- a/2_flatten_images/image_flattener.py +++ b/2_flatten_images/image_flattener.py @@ -50,7 +50,7 @@ def main(): args = parser.parse_args() if not os.path.exists(args.input): - print("Input directory does not exist.") + print(f"Warning: The specified input directory '{args.input}' does not exist. Please check the path and try again.") return if not os.path.exists(args.output): os.makedirs(args.output) diff --git a/3_trace_images/image_tracer.py b/3_trace_images/image_tracer.py index be58394..481e714 100644 --- a/3_trace_images/image_tracer.py +++ b/3_trace_images/image_tracer.py @@ -13,11 +13,18 @@ def make_edges(image, input_path, output_path): tail = os.path.split(image)[1] subdirectory = os.path.relpath(os.path.dirname(image), input_path) - output_subdir = os.path.join(output_path, subdirectory) + + # Check if the file is in the top-level directory + if subdirectory == '.': + output_subdir = output_path + output_filename = os.path.splitext(tail)[0] + '_edges.png' + else: + output_subdir = os.path.join(output_path, subdirectory + "_edges") + output_filename = os.path.splitext(tail)[0] + '.png' + os.makedirs(output_subdir, exist_ok=True) edges = cv2.Canny(img, 100, 200) - output_filename = os.path.splitext(tail)[0] + '_edges.png' output_filepath = os.path.join(output_subdir, output_filename) plt.imsave(output_filepath, edges, cmap='gray') print(f"Processed: {image} -> {output_filepath}") @@ -30,7 +37,7 @@ def process_image_files(input_path, output_path): for dirpath, dirs, files in os.walk(input_path): total = len(files) current = 0 - for file in files: + for file in files: current += 1 print(f"Processing {file}, #{current} of {total}") make_edges(os.path.join(dirpath, file), input_path, output_path) @@ -50,7 +57,7 @@ def main(): for input_path in args.input: if not os.path.exists(input_path): - print(f"Input directory does not exist: {input_path}") + print(f"Warning: The specified input directory '{input_path}' does not exist. Please check the path and try again.") else: print(f"Processing images in: {input_path}") process_image_files(input_path, args.output) diff --git a/3_trace_images/image_tracer.yaml b/3_trace_images/image_tracer.yaml index 811d935..1e3fb23 100644 --- a/3_trace_images/image_tracer.yaml +++ b/3_trace_images/image_tracer.yaml @@ -5,21 +5,22 @@ input: union: - pfs: repo: raw_videos_and_images + name: tracer glob: "/*.{png,jpg,jpeg}" - pfs: repo: image_flattener + name: tracer glob: "/*" transform: - image: lbliii/image_tracer:1.0.8 + image: lbliii/image_tracer:1.0.9 cmd: - python3 - /image_tracer.py - --input - - /pfs/raw_videos_and_images - - /pfs/image_flattener + - /pfs/tracer - --output - /pfs/out/ autoscaling: true -# docker buildx build --platform linux/amd64 -t lbliii/image_tracer:1.0.8 --push . \ No newline at end of file +# docker buildx build --platform linux/amd64 -t lbliii/image_tracer:1.0.9 --push . \ No newline at end of file diff --git a/4_gif_images/movie_gifer.py b/4_gif_images/movie_gifer.py index da69891..0919e28 100644 --- a/4_gif_images/movie_gifer.py +++ b/4_gif_images/movie_gifer.py @@ -63,7 +63,7 @@ def main(): for input_path in args.input: if not os.path.exists(input_path): - print(f"Input directory does not exist: {input_path}") + print(f"Warning: The specified input directory '{input_path}' does not exist. Please check the path and try again.") else: print(f"Processing images in: {input_path}") process_image_directories(input_path, args.output) diff --git a/4_gif_images/movie_gifer.yaml b/4_gif_images/movie_gifer.yaml index a3598a9..d7c0c79 100644 --- a/4_gif_images/movie_gifer.yaml +++ b/4_gif_images/movie_gifer.yaml @@ -4,21 +4,22 @@ input: union: - pfs: repo: image_flattener + name: gifer glob: "/*/" - pfs: repo: image_tracer + name: gifer glob: "/*/" transform: - image: lbliii/movie_gifer:1.0.5 + image: lbliii/movie_gifer:1.0.6 cmd: - python3 - /movie_gifer.py - --input - - /pfs/image_flattener - - /pfs/image_tracer + - /pfs/gifer - --output - /pfs/out/ autoscaling: true -# docker buildx build --platform linux/amd64 -t lbliii/movie_gifer:1.0.5 --push . \ No newline at end of file +# docker buildx build --platform linux/amd64 -t lbliii/movie_gifer:1.0.6 --push . \ No newline at end of file diff --git a/5_shuffle_content/content_shuffler.yaml b/5_shuffle_content/content_shuffler.yaml index 7f03eb3..0e31db4 100644 --- a/5_shuffle_content/content_shuffler.yaml +++ b/5_shuffle_content/content_shuffler.yaml @@ -4,27 +4,28 @@ input: union: - pfs: glob: "/" + name: shuffler repo: movie_gifer - pfs: glob: "/*.{png,jpg,jpeg}" + name: shuffler repo: raw_videos_and_images - pfs: glob: "/*.{png,jpg,jpeg}" + name: shuffler repo: image_tracer transform: - image: lbliii/content_shuffler:1.0.0 + image: lbliii/content_shuffler:1.0.1 cmd: - python3 - /content_shuffler.py - --input - - /pfs/movie_gifer - - /pfs/raw_videos_and_images - - /pfs/image_tracer + - /pfs/shuffler - --output - /pfs/out/ autoscaling: true -# docker buildx build --platform linux/amd64 -t lbliii/content_shuffler:1.0.0 --push . +# docker buildx build --platform linux/amd64 -t lbliii/content_shuffler:1.0.1 --push .