reframe-cli
Advanced tools
+16
-7
| Metadata-Version: 2.4 | ||
| Name: reframe-cli | ||
| Version: 1.1.0 | ||
| Version: 1.1.1 | ||
| Summary: ReFrame-CLI is a Python-based command-line tool to streamline your video and image manipulation tasks. Ideal for preparing image datasets for training machine learning models, including generative AI and diffusion models. Can handle videos of any length. | ||
| Home-page: https://github.com/ForgeL4bs/ReFrame | ||
| Author: Gour4v | ||
@@ -20,2 +19,3 @@ Author-email: chatgai.note@gmail.com | ||
| Requires-Dist: pillow-heif | ||
| Requires-Dist: tqdm | ||
| Dynamic: author | ||
@@ -26,3 +26,2 @@ Dynamic: author-email | ||
| Dynamic: description-content-type | ||
| Dynamic: home-page | ||
| Dynamic: license | ||
@@ -34,4 +33,8 @@ Dynamic: project-url | ||
| <h1 align="center">ReFrame-CLI</h1> | ||
| <p align=”center”> | ||
| <img src="assets/Frame 2.png" alt="my banner"> | ||
| </p> | ||
| [](https://www.python.org/) | ||
@@ -43,2 +46,4 @@ [](https://opencv.org/) | ||
| Reframe is still in development and we know it needs a lot of improvements, So communities contributions are really appreciated🙇. | ||
| --- | ||
@@ -65,4 +70,2 @@ | ||
| * **Frame Extraction:** Extracts frames from video files. | ||
| * **Specify Timelines** Extracts frames withing a specified timeline. | ||
| * **FPS Control:** Allows you to specify the frames per second (FPS) for extraction. If not specified, extracts all frames. | ||
| * **Convert Images**: Convert images between multiple formats such as PNG, JPG/JPEG, WEBP, HEIF/HEIC. | ||
@@ -72,3 +75,2 @@ * **Resize Images**: Resize images to desired size/ratio or use the multiplier to just upscale the size of the image. | ||
| * **GIF Creation**: An additional feature to create Animated GIFs just by stacking up multiple frames(images). | ||
| * **Command-Line Interface:** Easy-to-use command-line interface with clear arguments. | ||
| * **Cross-Platform:** Works on Linux, macOS, and Windows. | ||
@@ -237,2 +239,9 @@ | ||
| * Release: v1.1.1 | ||
| * Added a better progress bar using tqdm | ||
| * Removed PIL from image_resizer.py | ||
| ### April 29, 2025 | ||
| * Latest release of ReFrame-CLI-1.1.0 on [pypi](https://pypi.org/project/reframe-cli/) | ||
| * Added a new feature ~ **Image Resizer**. | ||
@@ -239,0 +248,0 @@ * Fixed some bugs inside Image converter. |
+14
-4
@@ -1,3 +0,7 @@ | ||
| <h1 align="center">ReFrame-CLI</h1> | ||
| <p align=”center”> | ||
| <img src="assets/Frame 2.png" alt="my banner"> | ||
| </p> | ||
| [](https://www.python.org/) | ||
@@ -9,2 +13,4 @@ [](https://opencv.org/) | ||
| Reframe is still in development and we know it needs a lot of improvements, So communities contributions are really appreciated🙇. | ||
| --- | ||
@@ -31,4 +37,2 @@ | ||
| * **Frame Extraction:** Extracts frames from video files. | ||
| * **Specify Timelines** Extracts frames withing a specified timeline. | ||
| * **FPS Control:** Allows you to specify the frames per second (FPS) for extraction. If not specified, extracts all frames. | ||
| * **Convert Images**: Convert images between multiple formats such as PNG, JPG/JPEG, WEBP, HEIF/HEIC. | ||
@@ -38,3 +42,2 @@ * **Resize Images**: Resize images to desired size/ratio or use the multiplier to just upscale the size of the image. | ||
| * **GIF Creation**: An additional feature to create Animated GIFs just by stacking up multiple frames(images). | ||
| * **Command-Line Interface:** Easy-to-use command-line interface with clear arguments. | ||
| * **Cross-Platform:** Works on Linux, macOS, and Windows. | ||
@@ -203,2 +206,9 @@ | ||
| * Release: v1.1.1 | ||
| * Added a better progress bar using tqdm | ||
| * Removed PIL from image_resizer.py | ||
| ### April 29, 2025 | ||
| * Latest release of ReFrame-CLI-1.1.0 on [pypi](https://pypi.org/project/reframe-cli/) | ||
| * Added a new feature ~ **Image Resizer**. | ||
@@ -205,0 +215,0 @@ * Fixed some bugs inside Image converter. |
| Metadata-Version: 2.4 | ||
| Name: reframe-cli | ||
| Version: 1.1.0 | ||
| Version: 1.1.1 | ||
| Summary: ReFrame-CLI is a Python-based command-line tool to streamline your video and image manipulation tasks. Ideal for preparing image datasets for training machine learning models, including generative AI and diffusion models. Can handle videos of any length. | ||
| Home-page: https://github.com/ForgeL4bs/ReFrame | ||
| Author: Gour4v | ||
@@ -20,2 +19,3 @@ Author-email: chatgai.note@gmail.com | ||
| Requires-Dist: pillow-heif | ||
| Requires-Dist: tqdm | ||
| Dynamic: author | ||
@@ -26,3 +26,2 @@ Dynamic: author-email | ||
| Dynamic: description-content-type | ||
| Dynamic: home-page | ||
| Dynamic: license | ||
@@ -34,4 +33,8 @@ Dynamic: project-url | ||
| <h1 align="center">ReFrame-CLI</h1> | ||
| <p align=”center”> | ||
| <img src="assets/Frame 2.png" alt="my banner"> | ||
| </p> | ||
| [](https://www.python.org/) | ||
@@ -43,2 +46,4 @@ [](https://opencv.org/) | ||
| Reframe is still in development and we know it needs a lot of improvements, So communities contributions are really appreciated🙇. | ||
| --- | ||
@@ -65,4 +70,2 @@ | ||
| * **Frame Extraction:** Extracts frames from video files. | ||
| * **Specify Timelines** Extracts frames withing a specified timeline. | ||
| * **FPS Control:** Allows you to specify the frames per second (FPS) for extraction. If not specified, extracts all frames. | ||
| * **Convert Images**: Convert images between multiple formats such as PNG, JPG/JPEG, WEBP, HEIF/HEIC. | ||
@@ -72,3 +75,2 @@ * **Resize Images**: Resize images to desired size/ratio or use the multiplier to just upscale the size of the image. | ||
| * **GIF Creation**: An additional feature to create Animated GIFs just by stacking up multiple frames(images). | ||
| * **Command-Line Interface:** Easy-to-use command-line interface with clear arguments. | ||
| * **Cross-Platform:** Works on Linux, macOS, and Windows. | ||
@@ -237,2 +239,9 @@ | ||
| * Release: v1.1.1 | ||
| * Added a better progress bar using tqdm | ||
| * Removed PIL from image_resizer.py | ||
| ### April 29, 2025 | ||
| * Latest release of ReFrame-CLI-1.1.0 on [pypi](https://pypi.org/project/reframe-cli/) | ||
| * Added a new feature ~ **Image Resizer**. | ||
@@ -239,0 +248,0 @@ * Fixed some bugs inside Image converter. |
@@ -5,1 +5,2 @@ opencv-python | ||
| pillow-heif | ||
| tqdm |
@@ -5,2 +5,3 @@ import cv2 # opencv library for video | ||
| import math | ||
| from tqdm import tqdm | ||
| from ReFrame.utils import create_output_dir | ||
@@ -96,26 +97,30 @@ | ||
| video_capture.set(cv2.CAP_PROP_POS_FRAMES, start_frame) | ||
| #tqdm progress bar(initialization of the bar) | ||
| total_frames_to_extract = (end_frame - start_frame) // frame_step + 1 | ||
| with tqdm(total=total_frames_to_extract, desc="Extracting frames", unit="frame") as pbar: | ||
| #loop through the video frames | ||
| while True: | ||
| #read the next frame from the video | ||
| success, frame = video_capture.read() | ||
| #loop through the video frames | ||
| while True: | ||
| #read the next frame from the video | ||
| success, frame = video_capture.read() | ||
| #if no more frames, break out of the loop | ||
| if not success or frame_number > end_frame: | ||
| break | ||
| #if no more frames, break out of the loop | ||
| if not success or frame_number > end_frame: | ||
| break | ||
| #naming convention (processing frames according to the frame_step that is the number of the frame) | ||
| if frame_number % frame_step == 0 and frame_number >= start_frame: | ||
| #construct the output file name | ||
| if format.lower() == 'png': | ||
| output_file = os.path.join(output_dir, f"frame_{extracted_frames_count:06d}.png") | ||
| cv2.imwrite(output_file, frame) #save the frame (note: format = png by default) | ||
| elif format.lower() in ['jpg', 'jpeg']: | ||
| output_file = os.path.join(output_dir, f"frame_{extracted_frames_count:06d}.jpg") | ||
| cv2.imwrite(output_file, frame, [int(cv2.IMWRITE_JPEG_QUALITY), 95]) #save as jpg | ||
| extracted_frames_count += 1 | ||
| #updating the progress bar | ||
| pbar.update(1) | ||
| #naming convention (processing frames according to the frame_step that is the number of the frame) | ||
| if frame_number % frame_step == 0 and frame_number >= start_frame: | ||
| #construct the output file name | ||
| if format.lower() == 'png': | ||
| output_file = os.path.join(output_dir, f"frame_{extracted_frames_count:06d}.png") | ||
| cv2.imwrite(output_file, frame) #save the frame (note: format = png by default) | ||
| elif format.lower() in ['jpg', 'jpeg']: | ||
| output_file = os.path.join(output_dir, f"frame_{extracted_frames_count:06d}.jpg") | ||
| cv2.imwrite(output_file, frame, [int(cv2.IMWRITE_JPEG_QUALITY), 95]) #save as jpg | ||
| print(f"Extracted frame {frame_number}/{total_frames}", end='\r') | ||
| extracted_frames_count += 1 | ||
| frame_number += 1 | ||
| frame_number += 1 | ||
| #release the video capture object to free some resources | ||
@@ -122,0 +127,0 @@ video_capture.release() |
+17
-14
@@ -5,2 +5,3 @@ import cv2 | ||
| import argparse | ||
| from tqdm import tqdm | ||
| from ReFrame.utils import create_output_dir | ||
@@ -50,17 +51,19 @@ | ||
| total_files = len(image_files) | ||
| for i, image_file in enumerate(image_files): | ||
| try: | ||
| img = cv2.imread(image_file) | ||
| if img is None: | ||
| print(f"Warning: Could not read image {image_file}. Skipping.") | ||
| continue | ||
| #convert from BGR to RGB for imageio to process | ||
| img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | ||
| images.append(img_rgb) | ||
| print(f"\rProcessing {i + 1}/{total_files} images...", end="") | ||
| except Exception as e: | ||
| print(f"Error reading image {image_file}: {e}") | ||
| return | ||
| print() | ||
| #progress bar | ||
| with tqdm(total=total_files, desc="Processing images", unit="image") as pbar: | ||
| for image_file in image_files: | ||
| try: | ||
| img = cv2.imread(image_file) | ||
| if img is None: | ||
| print(f"Warning: Could not read image {image_file}. Skipping.") | ||
| continue | ||
| #convert from BGR to RGB for imageio to process | ||
| img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | ||
| images.append(img_rgb) | ||
| pbar.update(1) #update progress bar | ||
| except Exception as e: | ||
| print(f"Error reading image {image_file}: {e}") | ||
| return | ||
| if not images: | ||
@@ -67,0 +70,0 @@ print("Error: No valid images to create a GIF.") |
@@ -6,2 +6,3 @@ import cv2 | ||
| from PIL import Image #import Image from pillow library | ||
| from tqdm import tqdm | ||
| import sys | ||
@@ -145,13 +146,18 @@ from ReFrame.utils import create_output_dir | ||
| #get a list of files from the directory | ||
| files = os.listdir(image_dir) | ||
| files = [file for file in os.listdir(image_dir) if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic', '.heif'))] | ||
| total_files = len(files) | ||
| converted_count = 0 | ||
| for i, file in enumerate(files): | ||
| file_path = os.path.join(image_dir, file) | ||
| if os.path.isfile(file_path) and file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic', '.heif')): | ||
| process_file(file_path, output_dir, output_format, is_bulk=True) | ||
| converted_count += 1 | ||
| sys.stdout.write(f"\rConverted {converted_count}/{total_files}") | ||
| sys.stdout.flush() | ||
| print(f"\nFinished converting {converted_count} images.") | ||
| if total_files == 0: | ||
| print("No valid image files found in the directory.") | ||
| return | ||
| #tqdm for progress bar | ||
| with tqdm(total=total_files, desc="Converting images", unit="image") as pbar: | ||
| for file in files: | ||
| file_path = os.path.join(image_dir, file) | ||
| if os.path.isfile(file_path): | ||
| process_file(file_path, output_dir, output_format, is_bulk=True) | ||
| pbar.update(1) #updating the bar | ||
| print(f"\nFinished converting {total_files} images.") | ||
@@ -158,0 +164,0 @@ def main(): |
+16
-14
| import cv2 | ||
| import os | ||
| import argparse | ||
| from PIL import Image | ||
| import sys | ||
| from tqdm import tqdm | ||
| from ReFrame.utils import create_output_dir | ||
@@ -170,4 +170,9 @@ | ||
| #get files | ||
| files = os.listdir(image_dir) | ||
| files = [file for file in os.listdir(image_dir) if file.lower().endswith(('.png', '.jpg', '.jpeg'))] | ||
| total_files = len(files) | ||
| if total_files == 0: | ||
| print("No valid image files found in the directory.") | ||
| return | ||
| #handle unsupported files | ||
@@ -180,17 +185,14 @@ unsupported_files = [file for file in files if file.lower().endswith(('.heif', '.heic'))] | ||
| #process valid files | ||
| total_files = len(files) | ||
| converted_count = 0 | ||
| for i, file in enumerate(files): | ||
| file_path = os.path.join(image_dir, file) | ||
| if os.path.isfile(file_path) and file.lower().endswith(('.png', '.jpg', '.jpeg')): | ||
| process_file(file_path, output_dir, output_format, width, height, ratio, focal_point, multiplier, is_bulk=True) | ||
| converted_count += 1 | ||
| sys.stdout.write(f"\rProcessed {converted_count}/{total_files}") | ||
| sys.stdout.flush() | ||
| print(f"\nFinished resizing {converted_count} images.") | ||
| #progress bar | ||
| with tqdm(total=total_files, desc="Resizing images", unit="image") as pbar: | ||
| for file in files: | ||
| file_path = os.path.join(image_dir, file) | ||
| if os.path.isfile(file_path): | ||
| process_file(file_path, output_dir, output_format, width, height, ratio, focal_point, multiplier, is_bulk=True) | ||
| pbar.update(1) #update bar | ||
| print(f"\nFinished resizing {total_files} images.") | ||
| def resize_image(img, width=None, height=None, ratio=None, focal_point=None, multiplier=None): | ||
@@ -197,0 +199,0 @@ """ |
+2
-2
@@ -6,3 +6,3 @@ from setuptools import setup, find_packages | ||
| name="reframe-cli", | ||
| version="1.1.0", | ||
| version="1.1.1", | ||
| description="ReFrame-CLI is a Python-based command-line tool to streamline your video and image manipulation tasks. Ideal for preparing image datasets for training machine learning models, including generative AI and diffusion models. Can handle videos of any length.", | ||
@@ -13,3 +13,2 @@ long_description=open("readme.md").read() if os.path.exists("readme.md") else "", | ||
| author_email="chatgai.note@gmail.com", | ||
| url="https://github.com/ForgeL4bs/ReFrame", | ||
| license="MIT", | ||
@@ -22,2 +21,3 @@ packages=find_packages(include=["ReFrame", "ReFrame.*"]), | ||
| "pillow-heif", | ||
| "tqdm", | ||
| ], | ||
@@ -24,0 +24,0 @@ entry_points={ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
64751
1.31%797
1.4%