compatibility-family-learning
compatibility-family-learning copied to clipboard
Polyvore to Monomere like data in convert_polyvore.py
Can you please share the structure of data directories used in this script as polyvore website is down and I am having a hard time to understand how you generated negatives from the data and what is asin in polyvore data?
Hi demonking2,
The product id on polyvore site is used as ASINs.
Suppose Polyvore website is still alive, the crawler could be used to crawl the data. Specifically:
polyvore_outfit_from_userandpolyvore_outfitcan be used to grab the urls of outfits asOUTFIT.jl.- Using
OUTFIT.jlas input,polyvore_outfit_setgrabs information for each outfit as well as urls of the items in the outfits asOUTFIT_SET.jl. - Manually extract the item urls from
OUTFIT_SET.jland use the urls as input topolyvore_itemwould grab all item images in a directory as well as item informationITEM.jl. - Run
python -m cfl.scripts.preprocess_polyvore --items-store ITEMS_S3_STORE_PATH --image-dir IMAGES_DIR --output-dir data/polyvore, whereIMAGES_DIRis the image output ofpolyvore_itemandITEMS_S3_STORE_PATHstores the crawled items on S3.ITEMS_S3_STORE_PATHhas the following structure:ITEMS_S3_STORE_PATH/polyvore_item/: storesITEM.jlITEMS_S3_STORE_PATH/polyvore_outfit_set/: storesOUTFIT_SET.jl preprocess_polyvorewould produce the data structure:data/polyvore/images: stores processed imagesdata/polyvore/meta.txt: stores the product_id as well as categories of items.data/polyvore/cate_[n].txt: stores the product_ids for each category[n].data/polyvore/outfits.txt: stores the fav_count and items of each outfit.- Run
python -m cfl.keras.extract_v3 --input-dir data/polyvore/images --output-dir data/polyvore/latentswould produce latent vectors for each item image. - Run
./experiments/polyvore/convert_polyvore.sh, which produces the following data structure:parsed_data/polyvore_random/top_to_other/train/meta.txt: item ids as well as categoriesparsed_data/polyvore_random/top_to_other/train/pairs_pos.txt: positive pairsparsed_data/polyvore_random/top_to_other/train/pairs_neg.txt: negative pairsparsed_data/polyvore_random/top_to_other/train/pairs_all.txt: all pairsparsed_data/polyvore_random/top_to_other/train/features.b: features of itemsparsed_data/polyvore_random/top_to_other/train/source.txt: item ids from source categoriesparsed_data/polyvore_random/top_to_other/train/target.txt: item ids from target categoriesparsed_data/polyvore_random/top_to_other/val: the same structure astop_to_other/trainparsed_data/polyvore_random/top_to_other/test: the same structure astop_to_other/trainparsed_data/polyvore_random/bottom_to_other: the same structure astop_to_otherparsed_data/polyvore_random/shoe_to_other: the same structure astop_to_other
Negatives are generated by random sampling items from different categories as described in the paper.