parkpow / deep-license-plate-recognition

Automatic License Plate Recognition (ALPR) or Automatic Number Plate Recognition (ANPR) software that works with any camera.
https://platerecognizer.com/
MIT License
523 stars 122 forks source link

feat: (blur) validate `--images` path, add `--copy-exif` arg #184

Closed danleyb2 closed 7 months ago

github-actions[bot] commented 7 months ago

Risk Level 2 - /home/runner/work/deep-license-plate-recognition/deep-license-plate-recognition/blur/main.py

The changes include adding new command-line arguments and handling for those arguments. The risk is moderate due to potential issues with argument handling and directory validation.

  1. Argument Handling: The addition of --copy-exif is a good feature, but ensure that the functionality to copy EXIF data is implemented and tested thoroughly.

  2. Directory Validation: The check for args.images.is_dir() is crucial for ensuring the input directory is valid. However, consider providing a more user-friendly error message and potentially a suggestion for the user to check the path.

  3. Error Handling: The use of sys.exit with a formatted string is appropriate for command-line tools, but ensure that the error codes are consistent and meaningful.

  4. Logging Configuration: The logging configuration has been modified without a clear change. Ensure that the logging setup is still correct and that no configuration options have been accidentally removed.

Example for improved directory validation message:

if not args.images.is_dir():
    sys.exit(f\"Error: The specified images directory does not exist or is not a directory: {args.images}\")

🔧📂🚦


Powered by Code Review GPT