Images of Vietnam generated by AI (DALL-E)
|

DALL-E Viet: AI-Generated Images of Vietnam (with Code)

The DALL-E text-to-image AI is making waves in the arts community: with a few simple text prompts, you can generate (almost) photo-realistic images.

We used a free python-library called diffusers and explored what the AI thinks about Vietnam. We were surprised by the results!

TL;DR: internet-training images are biased towards China and Japan, which tinges our AI-images with non-Vietnamese stylings. However, some backpacker classic images, like Sapa and Ta Hien street, are rendered very well by the AI! (Thank you, tourists, for your thousands of English captions!)

SEE ALSO: our AI generated paintings of Vietnam using GANs

“Outside a nightclub in Saigon in the backpacker street with tables of people drinking beer”

These look just like Ta Hien street in Hanoi! With just a quick glance, I wouldn’t know whether these images were fake or not. No doubt, such on-point renderings are due to the massive amounts of backpackers and selfie-happy Vietnamese partiers on these popular streets.

As usual, the faces and sign-osts are pure nonsense. Plus, Vietnamese drinkers are much better looking.

“Socialist propaganda poster of a Vietnamese peasant holding a rifle”

Always a favourite among leftwing tourists in Vietnam: these Soviet-esque propaganda posters are everywhere in Vietnam, in tourist hot-spots as well as on murals in small villages.

The AI-understands the composition and threatening demeanor. But, minor details like the rifle are, of course, pour hallucinations by the AI.

“Halong Bay, Vietnam, with lots of tourist ships among a mountainous ocean bay”

Uncanny likeness to the real thing: the AI-imaginations of Halong Bay are near perfect, complete with chessy watermarks from tourism operators.

“Backpacker in Sapa, Vietnam” and “H’mong women in Sapa, Vietnam”

The womens’ faces aren’t pretty, but the renderings of rice terraces are amazing and spot on.

Interestingly, ethnic descriptors like “H’mong” aren’t resolvable by the AI. This is likely because the broader internet and its corpus of images are not aware of the huge ethnic diversity in Vietnam.

“A Vietnamese ghost flying above a shrine burning incense and food offerings for Ancestors”

Ancestor worship is the biggest (quasi)religion in Vietnam. These shrines are everywhere: in people’s houses, and in temples dedicated to past heros and kings, etc. The AI understands the chaotic bric-a-brac of food offerings and pennants.

Plus, we added a ghost, just for fun. The results are spooky and fun!!! The Vietnamese have a strong belief in ghosts, so it only seemed fitting to add a ghost.

“Painting of Vietnamese New Year festival with peach blossoms”

The Vietnamese New Year (Tet) is the biggest holiday in Vietnam. Chief among the decorations is the Hoa Dao tree (peach blossoms), like a Vietnamese Christmas tree. The paintings are so good, we may use them in our next post about Tet!

“Three Vietnamese office workers in white shirts smiling in a modern office with a lot of tropical plants”

Not yet ready for stock-photography, the AI-imaginations about Vietnamese office workers is a bit creepy.

On the plus side, the Gender Diversicrats would be proud of the modern Vietnamese office, both in reality and in the AI-hallucinations.

“Vietnamese street food”

Except for nonsensical menu text, these AI images of Vietnamese street food look tasty! Complete with random-dudes sitting on motor-bikes in the background. That is Vietnamese cuisine.

READ MORE: Go on a DIY Food Tour of Hanoi with our guide and map

“Black and white tattoo of Vietnamese soldier”

Not sure if anyone would adorn themselves with these tattoos. Nice try AI!

“Vietnamese beach with palm trees and bamboo shack selling coconuts for tourists”

Thatch-roofs and conical hats and coconuts — these are beautiful beaches that (unfortunately) are kind of rare in Vietnam. Check out Da Nang for something like this.

We love these images, though — we may be tempted to insert them into our blogs about Vietnamese beaches.

“Skinny Vietnamese man chopping cococuts with a machete on the beach with a pile of coconuts and lots of jungle plants in Vietnam”

The faces are all messed up, and the coconut’s are a little disproportionate with respect to the guys size.

In the future, if the AI makes a robot army, look for the disfigured faces as a clue.

“Painting of Vietnamese Emperor and Queen having a feast in the ancient royal palace with mandarins serving their masters”

These may be more Chinese and Thai than Vietnamese. However, we could get a copy-painter to render a real-life version, and I’m sure someone would buy it!

“Black and white tattoo of a Vietnamese Mermaid”

Beautiful Vietnamese mermaid in Halong Bay, Vietnam
Vietnamese mermaid

Its not a tattoo, but what an image! A beautiful mermaid in Vietnam, and she even has scales.

She is obviously in Halong Bay Vietnam. What a great image — and maybe promising tourism campaign image

“Crowded street in Saigon with a lot of cyclists”

Black and white photo of Cyclists on the streets of Saigon (Dall-E fake image)

Look closely and you’ll notice that everyone is riding a tandem bike. Grisly faces to boot. Nonetheless, what an amazing photo by Diffusers.

“Vietnamese ethnic tribe hut in Vietnamese mountain”

The scenery is like HaGiang, a place of wonderous geographic beauty and ethnic diversity in Northern Vietnam.

Would you want to stay at these vacation getaways? What about the creepy person in the doorway?

Generate Your Own AI-Images with Text-Prompts

It is easy to make your own AI-images from freely-available python libraries and pretrained Diffusion models.

Follow these steps:

  • Sign-up with Huggingface_hub at https://huggingface.co/welcome
  • Go to settings and get your “Personal Access Token”. It will be a long random string of digits and letters. You need to paste it into the code below.
  • Open a python terminal (for example, use free Google Colab with GPUs)
  • Run the following code, modifying the prompt variable to make an image that suits you.
!python

# install dependencies
!pip3 install ftfy spacy diffusers==0.2.3 transformers scipy

# import Difusers library
from torch import autocast
from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler

# check gpu availability
from torch.cuda import is_available
print(is_available())
# if is_available says 'True' then you should set device = 'cuda'; if False, set device='cpu'
if is_available():
   DEVICE = 'cuda'
else:
   DEVICE = 'cpu'

# you need to make an account with huggingface to get an access token.
YOUR_TOKEN="paste_in_your_token_from_huggingface"

lms = LMSDiscreteScheduler(
    beta_start = 0.00085,
    beta_end = 0.012,
    beta_schedule="scaled_linear"
)

pipe = StableDiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    scheduler=lms,
    use_auth_token=YOUR_TOKEN
)
# THIS WILL TAKE ~7 minutes to download everything, depending on your internet connection

pipe = pipe.to(DEVICE)

# Edit the prompt to make your image
prompt = "street food in Hanoi"

with autocast("cuda"):
    #image = pipe(prompt, guidance_scale=7.5)["sample"][0]
    samples = pipe(
        prompt, 
        guidance_scale=7.5,
        )["sample"]

image = samples[0]
image.save("my_ai_painting.png")

Enjoy!

If you need help. Leave us comment! We’d love to see your creations.

Similar Posts

One Comment

  1. I’m really grateful for this post. It’s clear that you’ve put a lot of effort into providing comprehensive information. It has provided me with new insights and a fresh perspective. Your dedication to sharing valuable content is commendable. Thank you for your work!

Leave a Reply