All Projects → AgentMaker → Paddle-DALL-E

AgentMaker / Paddle-DALL-E

Licence: Apache-2.0 License
A PaddlePaddle version implementation of DALL-E of OpenAI.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Paddle-DALL-E

Paddle-PerceptualSimilarity
LPIPS metric on PaddlePaddle. pip install paddle-lpips
Stars: ✭ 22 (-42.11%)
Mutual labels:  paddlepaddle
BookSource
《深度学习应用实战之PaddlePaddle》的源码
Stars: ✭ 17 (-55.26%)
Mutual labels:  paddlepaddle
PaTTA
A test times augmentation toolkit based on paddle2.0.
Stars: ✭ 106 (+178.95%)
Mutual labels:  paddlepaddle
PLSC
Paddle Large Scale Classification Tools,supports ArcFace, CosFace, PartialFC, Data Parallel + Model Parallel. Model includes ResNet, ViT, DeiT, FaceViT.
Stars: ✭ 113 (+197.37%)
Mutual labels:  paddlepaddle
insight-face-paddle
End-to-end face detection and recognition system using PaddlePaddle.
Stars: ✭ 52 (+36.84%)
Mutual labels:  paddlepaddle
FSL-Mate
FSL-Mate: A collection of resources for few-shot learning (FSL).
Stars: ✭ 1,346 (+3442.11%)
Mutual labels:  paddlepaddle
Paddle
PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
Stars: ✭ 17,232 (+45247.37%)
Mutual labels:  paddlepaddle
Paddle-RLBooks
Paddle-RLBooks is a reinforcement learning code study guide based on pure PaddlePaddle.
Stars: ✭ 113 (+197.37%)
Mutual labels:  paddlepaddle
Paddle-Custom-Operators
Paddle Custom Operators.
Stars: ✭ 24 (-36.84%)
Mutual labels:  paddlepaddle
InterpretDL
InterpretDL: Interpretation of Deep Learning Models,基于『飞桨』的模型可解释性算法库。
Stars: ✭ 121 (+218.42%)
Mutual labels:  paddlepaddle
PaddlePaddle-MTCNN
基于PaddlePaddle复现的MTCNN人脸检测模型
Stars: ✭ 23 (-39.47%)
Mutual labels:  paddlepaddle
Paddle-CLIP
A PaddlePaddle version implementation of CLIP of OpenAI.
Stars: ✭ 51 (+34.21%)
Mutual labels:  paddlepaddle
Paddle-Adversarial-Toolbox
Paddle-Adversarial-Toolbox (PAT) is a Python library for Deep Learning Security based on PaddlePaddle.
Stars: ✭ 16 (-57.89%)
Mutual labels:  paddlepaddle
Baidu Lane Segmentation
4th place solution in Baidu Autonomous Driving Lane Segmentation
Stars: ✭ 19 (-50%)
Mutual labels:  paddlepaddle
PaddlePaddle-Tutorial
PaddlePaddle Tutorial for Deep Learning Researchers.
Stars: ✭ 27 (-28.95%)
Mutual labels:  paddlepaddle
Paddle-Image-Models
A PaddlePaddle version image model zoo.
Stars: ✭ 131 (+244.74%)
Mutual labels:  paddlepaddle
deep-learning-platforms
deep-learning platforms,framework,data(深度学习平台、框架、资料)
Stars: ✭ 17 (-55.26%)
Mutual labels:  paddlepaddle
PaddleTokenizer
使用 PaddlePaddle 实现基于深度神经网络的中文分词引擎 | A DNN Chinese Tokenizer by Using PaddlePaddle
Stars: ✭ 14 (-63.16%)
Mutual labels:  paddlepaddle
Smart container
🍰🍎ColugoMum--Intelligent Retail Settlement Platform can accurately locate and identify each commodity, and can return a complete shopping list and the actual total price of commodities that customers should pay.
Stars: ✭ 141 (+271.05%)
Mutual labels:  paddlepaddle
Paddle-SEQ
低代码序列数据处理框架,最短两行即可完成训练任务!
Stars: ✭ 13 (-65.79%)
Mutual labels:  paddlepaddle

Paddle-DALL-E

GitHub forks GitHub Repo stars GitHub release (latest by date including pre-releases) GitHub
A PaddlePaddle version implementation of DALL-E of OpenAI. 【origin repo】

Now this implementation only include the dVAE part, can't generate images from text.

Install Package

  • Install by pip:
$ pip install paddledalle==1.0.0 -i https://pypi.python.org/pypi 

Quick Start

import paddle
import paddle.nn.functional as F
import paddle.vision.transforms as T
import paddle.vision.transforms.functional as TF

from PIL import Image
from dall_e import load_model, map_pixels, unmap_pixels

target_image_size = 256

def preprocess(img):
    s = min(img.size)

    if s < target_image_size:
        raise ValueError(f'min dim for image {s} < {target_image_size}')

    r = target_image_size / s
    s = (round(r * img.size[1]), round(r * img.size[0]))
    img = TF.resize(img, s, interpolation='lanczos')
    img = TF.center_crop(img, output_size=2 * [target_image_size])
    img = paddle.unsqueeze(T.ToTensor()(img), 0)
    return map_pixels(img)

enc = load_model('encoder', pretrained=True)
dec = load_model('decoder', pretrained=True)

img = Image.open('1000x-1.jpg')
x = preprocess(img)

z_logits = enc(x)
z = paddle.argmax(z_logits, axis=1)
z = F.one_hot(z, num_classes=enc.vocab_size).transpose((0, 3, 1, 2))

x_stats = dec(z)
x_rec = unmap_pixels(F.sigmoid(x_stats[:, :3]))

out = (x_rec[0].transpose((1, 2, 0))*255.).astype('uint8').numpy()
out = Image.fromarray(out)
out.show()

Contact us

Email : [email protected]
QQ Group : 1005109853

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].