Code Monkey home page Code Monkey logo

photo-ops's Introduction

photo-ops

A pipeline passing an image between different micro services to crop, caption, watermark, hashtagify and finally post it to social media.

NOTE: Currently all models used are cpu based.

Services

Process

  1. Receive a new image
  2. Store original image in local storage and save its path
  3. Retrieve the bounding box of the motif of the image and store it
  4. Crop (and compress) the image (resolution is based on a setting) so that the bounding box is centered
    1. Provide the user the option to re-crop the image, especially if the bounding box is too large for the resolution
  5. Generate a caption for the image
    1. Give the user the option to edit the caption
  6. Watermark the image (location is again based on a setting)
  7. Generate hashtags based on the caption

FRs

  • User can upload an image
  • User can crop the image
  • User gets a recommended crop based on the subject of the image (if the bounding box is not too large)
  • User can edit the caption
  • User gets a recommended caption based on the cropped image
  • User can edit the hashtags
  • User gets a recommended hashtags based on the caption
  • User can specify the watermark
  • User can freely move the watermark
  • User can specify the resolution of the image

Technical Requirements

  • The application should be able to run on a local machine
  • The application should be able to run on a server
  • The application should be able to run on a cloud provider
  • The application should be able to run on a container
  • The application should be able to run on a container orchestrator
  • All but the service accessed by the FE should only communicate via gRPC

Running the application

  • docker
  • docker-compose

Development

  • docker
  • docker-compose
  • Go
  • bash

photo-ops's People

Contributors

nico-i avatar renovate[bot] avatar dependabot[bot] avatar

Stargazers

Daniel Turner-Lloveras avatar

Watchers

 avatar

photo-ops's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yaml
dockerfile
services/caption_service_gateway/Dockerfile
  • golang 1.22.3-alpine3.18
services/motif_service/Dockerfile
  • python 3.10-slim
services/motif_service_gateway/Dockerfile
  • golang 1.22.3-alpine3.18
gomod
services/caption_service_gateway/go.mod
  • go 1.22.3
  • github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
  • google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e@d264139d666e
  • google.golang.org/grpc v1.64.0
  • google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
  • google.golang.org/protobuf v1.34.1
services/motif_service_gateway/go.mod
  • go 1.22.3
  • github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
  • google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8@0867130af1f8
  • google.golang.org/grpc v1.64.0
  • google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
  • google.golang.org/protobuf v1.34.1
pip_requirements
services/caption_service/requirements.txt
  • certifi ==2024.2.2
  • charset-normalizer ==3.3.2
  • filelock ==3.14.0
  • fsspec ==2024.5.0
  • googleapis-common-protos ==1.63.0
  • grpcio ==1.64.0
  • huggingface-hub ==0.23.1
  • idna ==3.7
  • Jinja2 ==3.1.4
  • MarkupSafe ==2.1.5
  • mpmath ==1.3.0
  • networkx ==3.3
  • numpy ==1.26.4
  • opencv-python ==4.9.0.80
  • packaging ==24.0
  • protobuf ==5.27.0
  • PyYAML ==6.0.1
  • regex ==2024.5.15
  • requests ==2.32.2
  • safetensors ==0.4.3
  • sympy ==1.12
  • tokenizers ==0.19.1
  • torch ==2.3.0
  • torchaudio ==2.3.0
  • torchvision ==0.18.0
  • tqdm ==4.66.4
  • transformers ==4.41.1
  • typing_extensions ==4.12.0
  • urllib3 ==2.2.1
services/motif_service/requirements.txt
  • attrs ==23.2.0
  • certifi ==2024.2.2
  • charset-normalizer ==3.3.2
  • coloredlogs ==15.0.1
  • distlib ==0.3.8
  • filelock ==3.14.0
  • flatbuffers ==24.3.25
  • googleapis-common-protos ==1.63.0
  • grpcio ==1.64.0
  • grpcio-tools ==1.64.0
  • humanfriendly ==10.0
  • idna ==3.7
  • imageio ==2.34.1
  • jsonschema ==4.22.0
  • jsonschema-specifications ==2023.12.1
  • lazy_loader ==0.4
  • llvmlite ==0.42.0
  • mpmath ==1.3.0
  • networkx ==3.3
  • numba ==0.59.1
  • numpy ==1.26.4
  • onnxruntime ==1.18.0
  • opencv-python-headless ==4.9.0.80
  • packaging ==24.0
  • pillow ==10.3.0
  • platformdirs ==4.2.2
  • pooch ==1.8.1
  • protobuf ==5.27.0
  • PyMatting ==1.1.12
  • referencing ==0.35.1
  • rembg ==2.0.56
  • requests ==2.32.2
  • rpds-py ==0.18.1
  • scikit-image ==0.23.2
  • scipy ==1.13.1
  • setuptools ==70.0.0
  • sympy ==1.12
  • tifffile ==2024.5.22
  • tqdm ==4.66.4
  • urllib3 ==2.2.1
  • virtualenv ==20.26.2

  • Check this box to trigger a request for Renovate to run again on this repository

Cache models

# Check if cached model and tokenizer exist
if os.path.exists("cached_model") and os.path.exists("cached_tokenizer"):
    model = AutoModelForSequenceClassification.from_pretrained("cached_model")
    tokenizer = AutoTokenizer.from_pretrained("cached_tokenizer")
else:
    # Load model and tokenizer
    model = AutoModelForSequenceClassification.from_pretrained("model_name")
    tokenizer = AutoTokenizer.from_pretrained("model_name")
    # Cache model and tokenizer
    model.save_pretrained("cached_model")
    tokenizer.save_pretrained("cached_tokenizer")

# Initialize pipeline
nlp_pipeline = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.