You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kaggle CLI: Dataset image upload via datasets metadata --update (#959)
Changes:
- Adds functionality to specify an image file on disk to upload and set
for the dataset, using default crops.
- Updates documentation about new parameters
Local testing:
- [screen](http://screen/78g4ZpYK96QUUh8)
-
[screencast](https://screencast.googleplex.com/cast/NDc2NjU5MjU3ODYxNzM0NHwwMmFjMTc4Yy1jZg)
http://b/500108129
Copy file name to clipboardExpand all lines: docs/datasets_metadata.md
+47-2Lines changed: 47 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ Here's an example containing file metadata:
54
54
],
55
55
"expectedUpdateFrequency": "monthly",
56
56
"userSpecifiedSources": "World Bank and OECD ([link](http://data.worldbank.org/indicator/NY.GDP.MKTP.CD))",
57
+
"image": "relative/path/to/new/image.png"
57
58
}
58
59
```
59
60
@@ -90,6 +91,10 @@ The following metadata is currently supported:
90
91
*`title`: Field description
91
92
*`type`: Field type. A best-effort list of types will be kept at the bottom of this page, but new types may be added that are not documented here.
92
93
*`keywords`: Contains an array of strings that correspond to an existing tag on Kaggle. If a specified tag doesn't exist, the upload will continue, but that specific tag won't be added.
94
+
*`kaggle datasets metadata --update` (update metadata for an existing Dataset) supports all fields mentioned above for `kaggle datasets version`, and additionally:
95
+
*`expectedUpdateFrequency`: How often you expect to update your dataset with new versions. See [section below](#expected-update-frequencies) for possible values.
96
+
*`userSpecifiedSources`: An explanation of the source(s) of your dataset. Most basic markdown features are supported for this string.
97
+
*`image`: A relative file path to a new image file you want to use for your dataset. The path should be relative to the location of the dataset-metadata.json file. See [section below](#images) for more specifics about file types and expected image size.
93
98
94
99
We will add further metadata processing in upcoming versions of the API.
95
100
@@ -170,5 +175,45 @@ You can specify the following values for `expectedUpdateFrequency`:
170
175
*`daily`
171
176
*`hourly`
172
177
173
-
## Sources
174
-
You can report your dataset sources in a markdown string for `userSpecifiedSources`. Most basic markdown features are supported.
178
+
## Images
179
+
You can update your dataset image by providing a relative path from your `datasets-metadata.json` to an image file, using the `image` property.
180
+
181
+
For example, if your metadata file and image are located at:
182
+
-`/some/path/dataset-metadata.json`
183
+
-`/some/path/image.png`
184
+
185
+
This property should be specified as:
186
+
```
187
+
"image": "image.png"
188
+
```
189
+
190
+
If instead, your files were located at:
191
+
-`/some/path/dataset-metadata.json`
192
+
-`/some/path/alternative/path/to/other-image.jpg`
193
+
194
+
This property should be specified as:
195
+
```
196
+
"image": "alternative/path/to/other-image.jpg"
197
+
```
198
+
199
+
### Supported image file types and expected dimensions
200
+
201
+
The following file types are supported:
202
+
203
+
*`.png`
204
+
*`.jpg`
205
+
*`.jpeg`
206
+
*`.webp`
207
+
208
+
The image needs to have a minimum width of 560px and a minimum height of 280px.
209
+
210
+
The same image file will be used for two different crops:
- For an image with dimensions 560px x 280px, this will be a centered 280px square.
218
+
219
+
While you can upload a larger image than 560px x 280px, the crops as specified above will be applied, and this may not look good. These crops can always be edited in the UI on kaggle.com on the settings page for your dataset.
0 commit comments