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

fix COPY_METADATA env usage with script #211

Closed danleyb2 closed 3 months ago

danleyb2 commented 3 months ago

include copy_metadata param only when set to true

github-actions[bot] commented 3 months ago

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

The changes include adding a new feature to copy metadata and handling API keys for authorization. Here are some suggestions:

  1. Ensure that the args.copy_metadata flag is properly documented and tested, as it affects the data payload.

  2. When handling API keys, it's crucial to ensure they are not logged or exposed in any way. The current changes do not directly expose the API key, but be cautious with logging around areas where the API key is used.

  3. The error handling for the response status code could be more robust. Consider using response.raise_for_status() for a more concise approach:

    try:
       response.raise_for_status()
    except requests.exceptions.HTTPError as err:
       raise BlurError(f\"HTTP error occurred: {err}\")
  4. The process function is becoming complex. While not requested to break down functions, consider if future changes might necessitate this for maintainability.


🔒📝🛠️


Powered by Code Review GPT

marcbelmont commented 3 months ago

@danleyb2, merge if no further edits are needed.