robmarkcole / coral-pi-rest-server

Perform inferencing of tensorflow-lite models on an RPi with acceleration from Coral USB stick
https://coral.ai/products/accelerator
MIT License
67 stars 20 forks source link

Use guard clauses #44

Open robmarkcole opened 4 years ago

robmarkcole commented 4 years ago

Use if flask.request.method != "POST" or not flask.request.files.get("image"):, do the negative. This saves indentation. Same for if not predictions

https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html