Skip to content

This repo contains edit directions for 100 more classes for the paper pix2pix-zero AKA "Zero-shot Image-to-Image Translation". Also contains code for how to generate them using GPT-3.5.

License

Notifications You must be signed in to change notification settings

rahulvigneswaran/pix2pix-zero-directions

Repository files navigation

pix2pix-zero-directions

Welcome to the pix2pix-zero-directions repository! Here, you will find edit directions for 100 additional classes for the paper "Zero-shot Image-to-Image Translation," also known as pix2pix-zero. Additionally, we have included code on how to generate these directions using GPT-3.5.

⚠️ You need OpenAI's API key if you want to generate your own texts. If you just want to use the embedding for the 100 classes provided in this repo, you dont require it.

To get started, follow these steps:

  1. Run main.py to generate 1000 sentences per class. We have designed the code to be robust to OpenAI's API failures. You can adjust the number of generated sentences per class using the count parameter.
  2. Use clean_generated_text.py to remove any garbage sentences from the generated text.
  3. Run gen_direction.py to generate the direction for each class using the cleaned sentences found in the cleaned_gen directory. The directions are saved in the embeddings directory. This script also generates 100_class_dict.pt, which contains the directions in a convenient dict format.
  4. Use embeddings folder if you just want to access the embeddings for 100 provided classes.

Available classes

We have provided a list of available classes below, which includes 100 classes (CIFAR100) in total.

fine_labels = [
    'apple',  # id 0
    'aquarium_fish',
    'baby',
    'bear',
    'beaver',
    'bed',
    'bee',
    'beetle',
    'bicycle',
    'bottle',
    'bowl',
    'boy',
    'bridge',
    'bus',
    'butterfly',
    'camel',
    'can',
    'castle',
    'caterpillar',
    'cattle',
    'chair',
    'chimpanzee',
    'clock',
    'cloud',
    'cockroach',
    'couch',
    'crab',
    'crocodile',
    'cup',
    'dinosaur',
    'dolphin',
    'elephant',
    'flatfish',
    'forest',
    'fox',
    'girl',
    'hamster',
    'house',
    'kangaroo',
    'computer_keyboard',
    'lamp',
    'lawn_mower',
    'leopard',
    'lion',
    'lizard',
    'lobster',
    'man',
    'maple_tree',
    'motorcycle',
    'mountain',
    'mouse',
    'mushroom',
    'oak_tree',
    'orange',
    'orchid',
    'otter',
    'palm_tree',
    'pear',
    'pickup_truck',
    'pine_tree',
    'plain',
    'plate',
    'poppy',
    'porcupine',
    'possum',
    'rabbit',
    'raccoon',
    'ray',
    'road',
    'rocket',
    'rose',
    'sea',
    'seal',
    'shark',
    'shrew',
    'skunk',
    'skyscraper',
    'snail',
    'snake',
    'spider',
    'squirrel',
    'streetcar',
    'sunflower',
    'sweet_pepper',
    'table',
    'tank',
    'telephone',
    'television',
    'tiger',
    'tractor',
    'train',
    'trout',
    'tulip',
    'turtle',
    'wardrobe',
    'whale',
    'willow_tree',
    'wolf',
    'woman',
    'worm',
]

About

This repo contains edit directions for 100 more classes for the paper pix2pix-zero AKA "Zero-shot Image-to-Image Translation". Also contains code for how to generate them using GPT-3.5.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages