GithubHelp home page GithubHelp logo

samedii / perceptor Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.12 MB

Modular image generation library

License: Other

Python 91.59% C++ 2.05% Cuda 6.36%
pytorch text-to-image-synthesis vq-vae guided-diffusion style-transfer stable-diffusion

perceptor's Introduction

perceptor

Modular image generation library.

Install

poetry add perceptor

Or, for the old timers:

pip install perceptor

CUDA 11.3 (Support RTX cards)

poetry run pip uninstall torch torchvision -y && poetry run pip install torch==1.12.1 torchvision==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu113

Interface

Shortlist of available features. See the API reference for more information.

perceptor
  .drawers
    .BruteDiffusion
    .DeepImagePrior
    .Raw
    .RuDALLE
    .StyleGANXL
  .models
    .AdaBinsDepth
    .DeepImagePrior
    .VelocityDiffusion (yfcc_2, yfcc_1, cc12m_1_cfg, wikiart)
    .latent_diffusion
      .Text2Image
      .Face
      .SuperResolution
    .GuidedDiffusion (openai, pixelart)
    .MidasDepth
    .MonsterDiffusion (all, tinyhero)
    .StyleGANXL
    .RuDALLE
    .StableDiffusion
    .SuperResolution
  .losses
    # Text-image similarity
    .BLIP
    .CLIP
    .CLOOB
    .LiT
    .GlideCLIP
    .OpenCLIP
    .OWLViT
    .RuCLIP
    .SLIP
    # Other
    .AestheticVisualAssessment
    .LPIPS
    .Memorability
    .MidasDepth
    .SimulacraAesthetic
    .Smoothness
    .StyleTransfer
  .transforms
    .clamp_with_grad
    .resize
    .SuperResolution
  .utils
    .gradient_checkpoint

perceptor's People

Contributors

altsoph avatar bfirsh avatar bfrasure avatar dribnet avatar mitchellgordon95 avatar paullowenstrom avatar rvorias avatar samedii avatar sgallag-insta avatar syllebra avatar xxchampionsxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wn1695173791

perceptor's Issues

spherical loss for blip

I noticed the use of the spherical loss in the BLIP files. What is the gain you get from this loss?

FLAVA model

https://huggingface.co/docs/transformers/model_doc/flava

from PIL import Image
import requests
from transformers import FlavaProcessor, FlavaModel

model = FlavaModel.from_pretrained("facebook/flava-full")
processor = FlavaProcessor.from_pretrained("facebook/flava-full")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(text=["a photo of a cat"], images=image, return_tensors="pt", padding=True)

outputs = model(**inputs)
logits_per_image = outputs.contrastive_logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities

Add diffusers face model

https://github.com/huggingface/diffusers

from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline

model_id = "google/ddpm-celebahq-256"

# load model and scheduler
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference

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.