├── images └── FCDBv2.png ├── .gitignore ├── ImageFolder.py ├── CocoFormat.py ├── README_jpn.md ├── VocFormat.py └── README.md /images/FCDBv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cvpaperchallenge/FashionCultureDataBase_DLoader/HEAD/images/FCDBv2.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /ImageFolder.py: -------------------------------------------------------------------------------- 1 | import os 2 | import argparse 3 | import json 4 | import urllib.error 5 | import urllib.request 6 | from PIL import Image 7 | 8 | parser = argparse.ArgumentParser(description = 'collect FCDBv2 from YFCC100M') 9 | parser.add_argument('--yfcc', default='./yfcc100m_dataset', type=str, help='path for yfcc100m metadata') 10 | parser.add_argument('--id_json', default='./image_id_list.json', type=str, help='path for image id list') 11 | parser.add_argument('--save_dir', default='./ImageFolder', type=str, help='path for save dir') 12 | args = parser.parse_args() 13 | 14 | CITYS = {'London': (-0.12776, 51.50735), 'NewYork': (-74.0059, 40.71278), 15 | 'Boston': (-71.0589, 42.36008), 'Paris': (2.352222, 48.85661), 16 | 'Toronto': (-79.3832, 43.65323), 'Barcelona': (2.173403, 41.38506), 17 | 'Tokyo': (139.6917, 35.68949), 'SanFrancisco': (122.419, 37.77493), 18 | 'HongKong': (114.1095, 22.39643), 'Zurich': (8.541694, 47.37689), 19 | 'Seoul': (126.978, 37.56654), 'Beijing': (116.4074, 39.90421), 20 | 'Bangkok': (100.5018, 13.75633), 'Singapore': (103.8198, 1.352083), 21 | 'KualaLumpur': (101.6869, 3.139003), 'NewDelhi': (77.20902, 28.61394)} 22 | 23 | os.mkdir(args.save_dir) 24 | for name in CITYS.keys(): os.mkdir(os.path.join(args.save_dir, name)) 25 | 26 | # Load metadata and ImageID list 27 | print('Loading Data...') 28 | f1 = open(args.yfcc) 29 | lines = f1.readlines() 30 | f2 = open(args.id_json, 'r') 31 | ids = json.load(f2) 32 | 33 | err = 0 34 | all = len(ids.items()) 35 | # Start Main loop 36 | print('Start!!') 37 | for i, (k, v) in enumerate(ids.items()): 38 | line = lines[int(k)] 39 | line_split = line.strip().split('\t') 40 | photo_id = line_split[1] 41 | Longitude = float(line_split[13]) 42 | Latitude = float(line_split[14]) 43 | photo_url = line_split[16] 44 | 45 | euclids = [] 46 | for LL in CITYS.values(): 47 | euc = (Longitude - LL[0])**2 + (Latitude - LL[1])**2 48 | euclids.append(euc) 49 | city_txt = list(CITYS.keys())[euclids.index(min(euclids))] 50 | 51 | # Download Images 52 | ori_img_path = os.path.join(args.save_dir, photo_id + '.jpg') 53 | if os.path.exists(ori_img_path) == True: continue 54 | try: 55 | with urllib.request.urlopen(photo_url) as web_file: 56 | data = web_file.read() 57 | with open(ori_img_path, mode='wb') as local_file: 58 | local_file.write(data) 59 | except: 60 | continue 61 | 62 | try: 63 | img = Image.open(ori_img_path) 64 | except: 65 | os.remove(ori_img_path) 66 | continue 67 | 68 | for j, box in enumerate(v): 69 | coor = (box[0], box[1], box[2], box[3]) 70 | save_img_path = os.path.join(args.save_dir, city_txt, 71 | photo_id + '_' + str(j) + '.jpg') 72 | try: 73 | img.crop(coor).save(save_img_path, quality=95) 74 | except: 75 | continue 76 | 77 | os.remove(ori_img_path) 78 | 79 | if (i + 1) % 2500 == 0: 80 | print('Progress:', i + 1, '/', all) 81 | -------------------------------------------------------------------------------- /CocoFormat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import argparse 3 | import json 4 | import urllib.error 5 | import urllib.request 6 | from PIL import Image 7 | from xml.etree.ElementTree import Element, SubElement, Comment, tostring 8 | import xml.etree.ElementTree as ET 9 | 10 | parser = argparse.ArgumentParser(description = 'Collect FCDBv2 from YFCC100M') 11 | parser.add_argument('--yfcc', default='./yfcc100m_dataset', type=str, help='path for yfcc100m metadata') 12 | parser.add_argument('--id_json', default='./image_id_list.json', type=str, help='path for image id list') 13 | parser.add_argument('--save_dir', default='./VOC_format', type=str, help='path for save dir') 14 | args = parser.parse_args() 15 | 16 | # make save dirs 17 | os.mkdir(args.save_dir) 18 | os.mkdir(os.path.join(args.save_dir, 'images')) 19 | 20 | # infomation 21 | info = { 22 | "description": "FCDBv2", 23 | "url": "http://", 24 | "version": "1.0", 25 | "year": 2019, 26 | "contributor": "AIST", 27 | "date_created": "2019/12/01" 28 | } 29 | categories = [ 30 | {"supercategory": "human", "id": 1, "name": "person"} 31 | ] 32 | images = [] 33 | annotations = [] 34 | 35 | # Load metadata and ImageID list 36 | print('Loading Data...') 37 | f1 = open(args.yfcc) 38 | lines = f1.readlines() 39 | f2 = open(args.id_json, 'r') 40 | ids = json.load(f2) 41 | 42 | err = 0 43 | obj_id = 1 44 | all = len(ids.items()) 45 | # Start Main loop 46 | print('Start!!') 47 | for img_id, (k, v) in enumerate(ids.items()): 48 | line = lines[int(k)] 49 | line_split = line.strip().split('\t') 50 | photo_id = line_split[1] 51 | photo_url = line_split[16] 52 | 53 | # Download Images 54 | save_img_path = os.path.join(args.save_dir, 'images', photo_id + '.jpg') 55 | if os.path.exists(save_img_path) == True: continue 56 | try: 57 | with urllib.request.urlopen(photo_url) as web_file: 58 | data = web_file.read() 59 | with open(save_img_path, mode='wb') as local_file: 60 | local_file.write(data) 61 | except: 62 | err += 1 63 | continue 64 | 65 | try: 66 | img = Image.open(save_img_path) 67 | size = img.size 68 | except: 69 | os.remove(save_img_path) 70 | err += 1 71 | continue 72 | 73 | # Make COCO format 74 | img_data = { 75 | "file_name": photo_id + '.jpg', 76 | "height": size[1], 77 | "width": size[0], 78 | "id": img_id 79 | } 80 | images.append(img_data) 81 | 82 | for box in v: 83 | anno_data = { 84 | "image_id": img_id, 85 | "bbox": [box[0], box[1], box[2] - box[0], box[3] - box[1]], 86 | "category_id": 1, 87 | "id": obj_id 88 | } 89 | obj_id += 1 90 | annotations.append(anno_data) 91 | 92 | if (img_id + 1) % 2500 == 0: 93 | print('Progress:', img_id + 1, '/', all) 94 | 95 | dict_ = {} 96 | dict_["info"] = info 97 | dict_["images"] = images 98 | dict_["annotations"] = annotations 99 | dict_["categories"] = categories 100 | 101 | save_path = os.path.join(args.save_dir, 'FCDBv2_train.json') 102 | fw = open(save_path,'w') 103 | json.dump(dict_, fw) 104 | 105 | print('Saved :', img_id + 1 - err) 106 | print('Error :', err) 107 | print('Finish!!') 108 | -------------------------------------------------------------------------------- /README_jpn.md: -------------------------------------------------------------------------------- 1 | # Fashion Culture DataBase (FCDB) 2 | ## Updates 3 | * 2020/03/26: 事前学習モデルの重みを公開 4 | * 2020/03/04: レポジトリの公開 5 | * 2019/11/08: レポジトリの作成 6 | 7 | ## Summary 8 | FCDBは以下の文献に従い,構成されております. 9 | [Kaori Abe, Teppei Suzuki, Shunya Ueta, Akio Nakamura, Yutaka Satoh, Hirokatsu Kataoka 10 | "Changing Fashion Cultures," arXiv pre-print:1703.07920, 2017.][1] 11 | 12 | [Hirokatsu Kataoka, Kaori Abe, Munetaka Minoguchi, Akio Nakamura and Yutaka Satoh 13 | "Ten-million-order Human Database for World-wide Fashion Culture Analysis," 14 | Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshop (CVPRW), 2019.][2] 15 | 16 | 本レポジトリはFCDBを構成するためのコードやbounding box(bbox; 検出枠)の情報を含みます。FCDBのオリジナル画像はYFCC100Mをベースとして構成しているため、画像やFlickrに含まれるメタ情報などのデータを公開することはできません。従って、著者らで生成したbboxのデータや、FCDBの構築に必要なコードのみを公開し、YFCC100Mと合わせて使用して頂くことでFCDBを再現することが可能です。 17 | 本レポジトリで共有するものは以下の通りです。 18 | * FCDB構築に必要な画像IDおよびbboxの一覧 19 | * 3種の形式でのFCDBの構築 20 | * 画像のみ収集 (16都市ごとにディレクトリを形成) 21 | * Pascal VOC形式 (人物検出用) 22 | * MS COCO形式 (人物検出用) 23 | 24 | また、FCDBを大規模事前学習用データセットとした人物検出タスクへの応用についても検証しております。論文はarXiv.orgで公開中です。 25 | 26 | [Munetaka Minoguchi, Ken Okayama, Yutaka Satoh, Hirokatsu Kataoka 27 | “Weakly Supervised Dataset Collection for Robust Person Detection” 28 | arXiv pre-print:2003.12263, 2020.][8] 29 | 30 | ## Citation 31 | 文献での掲載は以下の内容でお願いします。 32 | 33 | ``` 34 | @inproceedings{KataokaCVPRW2019_FCDB, 35 | author={Hirokatsu Kataoka and Kaori Abe and Munetaka Minoguchi and Akio Nakamura and Yutaka Satoh}, 36 | title={Ten-million-order Human Database for World-wide Fashion Culture Analysis}, 37 | booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshop (CVPRW)}, 38 | year={2019}, 39 | } 40 | 41 | @inproceedings{Minoguchi_WSPD, 42 | author={Munetaka Minoguchi and Ken Okayama and Yutaka Satoh and Hirokatsu Kataoka}, 43 | title={Weakly Supervised Dataset Collection for Robust Person Detection}, 44 | booktitle={arXiv pre-print:2003.12263}, 45 | year={2020}, 46 | } 47 | ``` 48 | 49 | ## Requirements 50 | * python 3 51 | * numpy, xml, json, argparse 52 | * 400 GB程度の空き容量 53 | 54 | ## Preparation 55 | FCDBはYFCC100Mを基に構築した画像データベースであるため、あらかじめYFCC100Mをダウンロードする必要があります。また、FCDB使用に関するライセンスやその他の権利はYFCC100Mに帰属します。 56 | YFCC100Mのダウンロード方法については[YFCC100M][3]をご確認ください。 57 | 必要なデータはAmazon s3から取得することができる`yfcc100m_dataset`です。 58 | 59 | ## Download 60 | * ImageIDとbbox 61 | FCDB構築に必要な画像IDとbboxが対になったデータはこちらの[フォーム][4]にご記入・ご投稿頂いた後、確認の上で入手可能なリンクをご案内致します。 62 | 63 | * 事前学習モデルの重み 64 | [M2Det][5]と[SSD][6]によってFCDBを学習した重みを提供します。ハイパーパラメータなどのconfigurationは、各実装のレポジトリのデフォルトに従います。 65 | ダウンロードリンクは[こちら][7]です。 66 | 67 | ## Running the code 68 | 構築するデータ形式ごとに実行するコードが異なります。 69 | ※データのパス、保存先の引数を適切に設定してください。 70 | 71 | #### 16 citys Directory 72 | ディレクトリを都市ごとに分割してFCDBを構築します。FCDBは16都市に分割されます。 73 | ``` 74 | python ImageFolder.py --yfcc='./yfcc100m_dataset' \ 75 | --id_json='./image_id_list.json' \ 76 | --save_dir='./FCDBv2' 77 | ``` 78 | 79 | #### Pascal VOC (for Person Detection) 80 | 物体検出で使用されるPascal VOC形式でFCDBを構築します。画像IDとbboxを対応付ける処理です。 81 | ``` 82 | python VocFormat.py --yfcc='./yfcc100m_dataset' \ 83 | --id_json='./image_id_list.json' \ 84 | --save_dir='./FCDBv2' 85 | ``` 86 | 87 | #### MS COCO (for Person Detection) 88 | 物体検出で使用されるMS COCO形式でFCDBを構築します。画像IDとbboxを対応付ける処理です。 89 | ``` 90 | python CocoFormat.py --yfcc='./yfcc100m_dataset' \ 91 | --id_json='./image_id_list.json' \ 92 | --save_dir='./FCDBv2' 93 | ``` 94 | 95 | 96 | [1]:https://arxiv.org/abs/1703.07920 97 | [2]:http://openaccess.thecvf.com/content_CVPRW_2019/html/FFSS-USAD/Kataoka_Ten-Million-Order_Human_Database_for_World-Wide_Fashion_Culture_Analysis_CVPRW_2019_paper.html 98 | [3]:http://projects.dfki.uni-kl.de/yfcc100m/ 99 | [4]:https://forms.gle/ewTpFi6iYsnrairK6 100 | [5]:https://github.com/qijiezhao/M2Det 101 | [6]:https://github.com/amdegroot/ssd.pytorch 102 | [7]:https://drive.google.com/drive/folders/1iSTxdASUS8Kz2I-v7Q9xIY7MDMovF6uR?usp=sharing 103 | [8]:https://arxiv.org/abs/2003.12263 104 | -------------------------------------------------------------------------------- /VocFormat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import argparse 3 | import json 4 | import urllib.error 5 | import urllib.request 6 | from PIL import Image 7 | from xml.etree.ElementTree import Element, SubElement, Comment, tostring 8 | import xml.etree.ElementTree as ET 9 | 10 | parser = argparse.ArgumentParser(description = 'Collect FCDBv2 from YFCC100M') 11 | parser.add_argument('--yfcc', default='./yfcc100m_dataset', type=str, help='path for yfcc100m metadata') 12 | parser.add_argument('--id_json', default='./image_id_list.json', type=str, help='path for image id list') 13 | parser.add_argument('--save_dir', default='./VOC_format', type=str, help='path for save dir') 14 | args = parser.parse_args() 15 | 16 | # make save dirs 17 | os.mkdir(args.save_dir) 18 | os.mkdir(os.path.join(args.save_dir, 'Annotations')) 19 | os.mkdir(os.path.join(args.save_dir, 'JPEGImages')) 20 | os.mkdir(os.path.join(args.save_dir, 'ImageSets')) 21 | os.mkdir(os.path.join(args.save_dir, 'ImageSets', 'Main')) 22 | 23 | # Load metadata and ImageID list 24 | print('Loading Data...') 25 | f1 = open(args.yfcc) 26 | lines = f1.readlines() 27 | f2 = open(args.id_json, 'r') 28 | ids = json.load(f2) 29 | 30 | err = 0 31 | all = len(ids.items()) 32 | # Start Main loop 33 | print('Start!!') 34 | for i, (k, v) in enumerate(ids.items()): 35 | line = lines[int(k)] 36 | line_split = line.strip().split('\t') 37 | photo_id = line_split[1] 38 | photo_url = line_split[16] 39 | 40 | # Download Images 41 | save_img_path = os.path.join(args.save_dir, 'JPEGImages', photo_id + '.jpg') 42 | if os.path.exists(save_img_path) == True: continue 43 | try: 44 | with urllib.request.urlopen(photo_url) as web_file: 45 | data = web_file.read() 46 | with open(save_img_path, mode='wb') as local_file: 47 | local_file.write(data) 48 | except: 49 | err += 1 50 | continue 51 | 52 | try: 53 | img = Image.open(save_img_path) 54 | size = img.size 55 | except: 56 | os.remove(save_img_path) 57 | err += 1 58 | continue 59 | 60 | # Make VOC format 61 | annotation_el = Element('annotation') 62 | folder_el = SubElement(annotation_el, 'folder') 63 | folder_el.text = 'FCDBv2' 64 | filename_el = SubElement(annotation_el, 'filename') 65 | filename_el.text = photo_id 66 | 67 | source_el = SubElement(annotation_el, 'source') 68 | database_el = SubElement(source_el, 'database') 69 | database_el.text = 'Fashion Culture DataBase V2' 70 | size_el = SubElement(annotation_el, 'size') 71 | width_el = SubElement(size_el, 'width') 72 | width_el.text = str(size[0]) 73 | height_el = SubElement(size_el, 'height') 74 | height_el.text = str(size[1]) 75 | 76 | for box in v: 77 | object_el = SubElement(annotation_el, 'object') 78 | name_el = SubElement(object_el, 'name') 79 | name_el.text = 'person' 80 | diff_el = SubElement(object_el, 'difficult') 81 | diff_el.text = '0' 82 | bndbox_el = SubElement(object_el, 'bndbox') 83 | xmin_el = SubElement(bndbox_el, 'xmin') 84 | xmin_el.text = str(box[0]) 85 | ymin_el = SubElement(bndbox_el, 'ymin') 86 | ymin_el.text = str(box[1]) 87 | xmax_el = SubElement(bndbox_el, 'xmax') 88 | xmax_el.text = str(box[2]) 89 | ymax_el = SubElement(bndbox_el, 'ymax') 90 | ymax_el.text = str(box[3]) 91 | 92 | save_anno_path = os.path.join(args.save_dir, 'Annotations', photo_id + '.xml') 93 | tree = ET.ElementTree(element=annotation_el) 94 | tree.write(save_anno_path, xml_declaration = False) 95 | 96 | if (i + 1) % 2500 == 0: 97 | print('Progress:', i + 1, '/', all) 98 | 99 | print('Saved :', i + 1 - err) 100 | print('Error :', err) 101 | 102 | anno_files = os.listdir(os.path.join(args.save_dir, 'Annotations')) 103 | for anno_file in anno_files: 104 | name, ext = os.path.splitext(anno_file) 105 | text_p = name + " 1" 106 | text_t = name 107 | 108 | t = open(os.path.join(args.save_dir, 'ImageSets/Main/person_trainval.txt'), "a") 109 | t.write(text_p + "\n") 110 | t.close() 111 | 112 | t = open(os.path.join(args.save_dir, 'ImageSets/Main/trainval.txt'), "a") 113 | t.write(text_t + "\n") 114 | t.close() 115 | 116 | print('Finish!!') 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fashion Culture DataBase (FCDB) 2 | ## Issues 3 | * Mar. 4, 2020: YFCC100M, the source dataset of Fashion Culture DataBase currently may have an issue on downloading. 4 | Please check updates of [this page][3]. 5 | 6 | ## Updates 7 | * Mar. 26, 2020: Pre-train weights are published 8 | * Mar. 4, 2020: Repository is published 9 | * Nov. 8, 2019: Repository creation 10 | 11 | ## Summary 12 | FCDB has been constructed based on the following papers. 13 | 14 | [Kaori Abe, Teppei Suzuki, Shunya Ueta, Akio Nakamura, Yutaka Satoh, Hirokatsu Kataoka 15 | "Changing Fashion Cultures," arXiv pre-print:1703.07920, 2017.][1] 16 | 17 | [Hirokatsu Kataoka, Kaori Abe, Munetaka Minoguchi, Akio Nakamura and Yutaka Satoh 18 | "Ten-million-order Human Database for World-wide Fashion Culture Analysis," 19 | Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshop (CVPRW), 2019.][2] 20 | 21 | The repository provides codes and bounding boxes (bboxes) in order to construct FCDB which is based on YFCC100M dataset. Please note that we are NOT serving original images and meta information included in YFCC100M dataset. Therefore, please download YFCC100M images yourself by following the Yahoo's instruction. We are sharing only person bboxes which are corresponding to YFCC100M images. The detailed sharing files are shown below. 22 | * Image identification number (Image ID) and bboxes on FCDB 23 | * 3 types of dataset representation 24 | * Images divided into 16 directories 25 | * Pascal VOC format (for person detection) 26 | * MS COCO format (for person detection) 27 | 28 | Our FCDB is also applied as a large-scale pre-training dataset for person detection. Please see also the following paper. 29 | 30 | [Munetaka Minoguchi, Ken Okayama, Yutaka Satoh, Hirokatsu Kataoka 31 | “Weakly Supervised Dataset Collection for Robust Person Detection” 32 | arXiv pre-print:2003.12263, 2020.][8] 33 | 34 | ## Citation 35 | If you use the dataset or codes, please cite the following: 36 | 37 | ``` 38 | @inproceedings{KataokaCVPRW2019_FCDB, 39 | author={Hirokatsu Kataoka and Kaori Abe and Munetaka Minoguchi and Akio Nakamura and Yutaka Satoh}, 40 | title={Ten-million-order Human Database for World-wide Fashion Culture Analysis}, 41 | booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshop (CVPRW)}, 42 | year={2019}, 43 | } 44 | 45 | @inproceedings{Minoguchi_WSPD, 46 | author={Munetaka Minoguchi and Ken Okayama and Yutaka Satoh and Hirokatsu Kataoka}, 47 | title={Weakly Supervised Dataset Collection for Robust Person Detection}, 48 | booktitle={arXiv pre-print:2003.12263}, 49 | year={2020}, 50 | } 51 | ``` 52 | 53 | ## Requirements 54 | * python 3 55 | * numpy, xml, json, argparse 56 | * 400 GB vacant space in your computer 57 | 58 | ## Preparation 59 | A user must download YFCC100M in advance, due to FCDB has constructed based on YFCC100M. The rights including copyright and license are belonged to YFCC100M. Please refer to the description of YFCC100M [YFCC100M][3]. 60 | The required data can be available on `yfcc100m_dataset` on Amazon s3. 61 | 62 | ## Download 63 | * Image ID and bboxes 64 | Please fill out the [form][4] to obtain a file which contains image ID and bboxes. After our confirmation, we will send an email to get the file. 65 | 66 | * Pre-train weights 67 | We provide the weights of [M2Det][5] and [SSD][6] which are trained on FCDB. The configuration of each detector follows the default settings of each original repository. 68 | Download link is [here][7]. 69 | 70 | 71 | ## Running the code 72 | We provide three types of dataset representation. Please see the following instruction what you want. Please properly set a directory path in your environment. 73 | 74 | #### 16 cities 75 | FCDB is divided into 16 directories. Each directory corresponds to each city. 76 | ``` 77 | python ImageFolder.py --yfcc='./yfcc100m_dataset' \ 78 | --id_json='./image_id_list.json' \ 79 | --save_dir='./FCDBv2' 80 | ``` 81 | 82 | #### Pascal VOC (for Person Detection) 83 | FCDB is transformed to Pascal VOC format which is used in object detection. The image ID and bbox are paired. 84 | ``` 85 | python VocFormat.py --yfcc='./yfcc100m_dataset' \ 86 | --id_json='./image_id_list.json' \ 87 | --save_dir='./FCDBv2' 88 | ``` 89 | 90 | #### MS COCO (for Person Detection) 91 | FCDB is transformed to MS COCO format which is used in object detection. The image ID and bbox are paired. 92 | ``` 93 | python CocoFormat.py --yfcc='./yfcc100m_dataset' \ 94 | --id_json='./image_id_list.json' \ 95 | --save_dir='./FCDBv2' 96 | ``` 97 | 98 | 99 | [1]:https://arxiv.org/abs/1703.07920 100 | [2]:http://openaccess.thecvf.com/content_CVPRW_2019/html/FFSS-USAD/Kataoka_Ten-Million-Order_Human_Database_for_World-Wide_Fashion_Culture_Analysis_CVPRW_2019_paper.html 101 | [3]:http://projects.dfki.uni-kl.de/yfcc100m/ 102 | [4]:https://forms.gle/ewTpFi6iYsnrairK6 103 | [5]:https://github.com/qijiezhao/M2Det 104 | [6]:https://github.com/amdegroot/ssd.pytorch 105 | [7]:https://drive.google.com/drive/folders/1iSTxdASUS8Kz2I-v7Q9xIY7MDMovF6uR?usp=sharing 106 | [8]:https://arxiv.org/abs/2003.12263 107 | --------------------------------------------------------------------------------