File size: 4,173 Bytes
a4597a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "0dbc59b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "import glob\n",
    "from omegaconf import OmegaConf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "1fac2763",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_len = {}\n",
    "train_len = {}\n",
    "files = glob.glob(\"../../AVA_src/aesthetics_image_lists/*.jpgl\")\n",
    "for file in files:\n",
    "    file = file.split('/')[-1]\n",
    "    if 'test' in file:\n",
    "        test_len[file] = len(pd.read_csv(os.path.join(\"../../AVA_src/aesthetics_image_lists\",file), sep=\" \",header = None))\n",
    "    elif 'train' in file:\n",
    "        train_len[file] = len(pd.read_csv(os.path.join(\"../../AVA_src/aesthetics_image_lists\",file), sep=\" \",header = None))\n",
    "    else:\n",
    "        print(f\"Pass {file}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "0d089d64",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cityscape_test.jpgl: 2500\n",
      "portrait_test.jpgl: 2500\n",
      "stilllife_test.jpgl: 2500\n",
      "floral_test.jpgl: 2500\n",
      "architecture_test.jpgl: 2500\n",
      "animal_test.jpgl: 2500\n",
      "generic_test.jpgl: 20000\n",
      "landscape_test.jpgl: 2500\n",
      "fooddrink_test.jpgl: 2500\n",
      "\n",
      "generic_ls_train.jpgl: 20000\n",
      "portrait_train.jpgl: 2500\n",
      "landscape_train.jpgl: 2500\n",
      "architecture_train.jpgl: 2500\n",
      "animal_train.jpgl: 2500\n",
      "cityscape_train.jpgl: 2500\n",
      "floral_train.jpgl: 2500\n",
      "stilllife_train.jpgl: 2500\n",
      "fooddrink_train.jpgl: 2500\n",
      "generic_ss_train.jpgl: 2500\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(OmegaConf.to_yaml(test_len))\n",
    "print(OmegaConf.to_yaml(train_len))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "7e25c9f8",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_len = {}\n",
    "train_len = {}\n",
    "files = glob.glob(\"../../AVA_src/style_image_lists/*.jpgl\")\n",
    "for file in files:\n",
    "    file = file.split('/')[-1]\n",
    "    if 'test' in file:\n",
    "        test_len[file] = len(pd.read_csv(os.path.join(\"../../AVA_src/style_image_lists\",file), sep=\" \",header = None))\n",
    "    elif 'train' in file:\n",
    "        train_len[file] = len(pd.read_csv(os.path.join(\"../../AVA_src/style_image_lists\",file), sep=\" \",header = None))\n",
    "    else:\n",
    "        print(f\"Pass {file}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "86ff27df",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "test.jpgl: 2809\n",
      "\n",
      "train.jpgl: 11270\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(OmegaConf.to_yaml(test_len))\n",
    "print(OmegaConf.to_yaml(train_len))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "huggingface",
   "language": "python",
   "name": "huggingface"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.15"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}