Skip to content

Latest commit

 

History

History
executable file
·
40 lines (28 loc) · 1.57 KB

README.md

File metadata and controls

executable file
·
40 lines (28 loc) · 1.57 KB

Minimal Image FastAPI Endpoints

A quick and easy to use template to create image CRUD apps. Built around FastAPI and using Pydantic data models for fast queries.


Main objectives

  • To create a light and easily configurable barebones backend API solution to handle image CRUD.

  • To provide an index of uploaded images to

  • Allow for basic filter based image manipulation. (ie adjusting HSV, blurring, denoise etc.)

Main Features

  • Supports b64 and binary encoding for image blob handling.
  • Image statistics and metrics endpoint for quick querying and sorting of image data.
  • Saving image from endpoint to local storage.
  • Basic user authentication via JWT and support for guest interactions.
  • Database integration for user login and statistics.
  • Dynamic in-memory or disk caching of images.
  • Quickly pull images from an URL link or local file on the server.

By default images will be saved to directories within /tmp, change the directories in the .env file to save to a permanent directory.

Known issues

Sometimes the version of cryptography installed by pip is incompatible with pyjwt, and errors out with

File "/home/$USER/miniconda3/envs/tauth/lib/python3.9/site-packages/jwt/algorithms.py", line 262, in prepare_key
key = load_pem_private_key(key, password=None)
TypeError: load_pem_private_key() missing 1 required positional argument:'backend'

To rectify this, try running pip install --upgrade pyjwt[crypto] to reinstall jwt requirements.

Requirements

Based on fastapi-nano by rednafi : https://github.com/rednafi/ fastapi-nano