I want you to help me create a new FastAPI and REACT project. Let's start with FastAPI,…
- User
I want you to help me create a new FastAPI and REACT project. Let's start with FastAPI, I need step by step for setting up the project, I am going to need Pydantic, SQLAlchemy using a DB that is flexible such that, using SQLAlchemy I can have dynamically created tables from the REACT frontend UI, and supports imagehash perceptual hashes with hammingway distance comparisons for finding similar images, set up CORSMiddleware, I am going to want to be able to add Image entries into the database that can be pulled to caption the images using ViT-L, scorers like CHAD scorer, as I want to use this to be able to build datasets for training image generative AI diffusion models. So the workflow will be:
- add images to the database
- caption and score images, adding that info into flexible metadata in the database
- Be able to browse, filter and sort images using various metadata
- Add a selection of images to a dataset(separate from the main list, but it just links to the main images)
- Choose and build captions using CLIP and other captioners or taggers like WD14, with the ability to manually add to all image captions in the data set, or to individual images
- I also want to be able to run a caption "upsample" on the captions, in which I ran a prompt with the caption through an LLM to get back a more detailed caption built from the other caption.
- In this way we will have multiple captions per image in a dataset, using categories to organise them, such as "ground truth" captions, simple main subject captions, and the upsampled detailed captions.
- Easily add/remove images to and from the dataset
- Then once the dataset is built, I can "package out" the dataset which generates file pairs of images and .txt caption files to the requested folder
- The options when packaging up a dataset can be to build folders with the same images but the different captions, so a folder with all the images plus the "ground truth" in caption .txt files, and a folder with the images plus "simple main subject" captions, etc
Well, that is a lot to go through already, but that is the overall workflow I want to end up with, but first we need to setup the project.
- Assistant