Use DataSerializer instead of the default NumpySerializer when invoking the endpoint, to avoid the JPEG bytes getting wrapped in a npy format.
Move the pip install ahead of any Python imports as a general best-practice, because importing libraries before installs can cause caching issues in case any of the imported library versions are affected by the installs.
Prefer %pip install over !pip3 install, as the former should be guaranteed to always use the pip/Python environment that the current notebook kernel is running - whereas the latter may sometimes differ.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available: #7
Description of changes:
import
s as a general best-practice, because importing libraries before installs can cause caching issues in case any of the imported library versions are affected by the installs.%pip install
over!pip3 install
, as the former should be guaranteed to always use the pip/Python environment that the current notebook kernel is running - whereas the latter may sometimes differ.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.