Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 918 Bytes

File metadata and controls

28 lines (19 loc) · 918 Bytes

Creating the CNN dataset

create_images.py

Converts files from an input folder into grayscale PNG images and saves them under an output label folder.

Usage

python create_images.py -f <folder_path> -o <output_folder> -l

-f, --folder-path: Path to the folder containing input files -o, --output-folder: Path where converted images will be saved -l, --label: Output subfolder label. Must be one of: -- malicious -- benign

Output

Images are saved to: <output_folder>//

Each file is converted to a 224 x 224 grayscale PNG using its stem as the output filename.

Example

python create_images.py -f ./malware_dataset/malicious -o ./malware_images -l malicious

Notes

  • The script reads each file as raw bytes and maps the bytes into a grayscale image.
  • The current implementation counts .exe files in its status message, but it iterates over all files in the folder during conversion.