Skip to content

Commit cde28c9

Browse files
committed
update hf collection example
1 parent 8e0d87e commit cde28c9

1 file changed

Lines changed: 75 additions & 37 deletions

File tree

‎inst/extdata/config_hf_example.yml‎

Lines changed: 75 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,94 @@
22
#
33
# To share a data cube on HuggingFace, store the images in a dataset
44
# repository, naming them "<satellite>_<sensor>_<tile>_<band>_<date>.<ext>"
5-
# (the convention used for local data cubes), and place a file named
6-
# "sits.yml" at the root of the repository, describing the collection as
7-
# below. HuggingFace names are converted to sits names (upper case, with
8-
# characters other than letters, digits and "-" replaced by "-"); the same
9-
# conversion applies to the satellite and sensor names, which are part of the
10-
# names of files written by sits. The cube is then opened with:
5+
# (the convention used for local data cubes)
6+
#
7+
# Then, place a file "sits.yml" in the root of the repository, describing the
8+
# collection as much as possible. The content of this file can be the same one
9+
# as defined in any collection registered in sits. This means you are able to
10+
# define things like `bands`, `satellite`, `sensor`, `platforms` and so on.
11+
#
12+
# Once you have the dataset with files and the "sits.yml", you can load it using
13+
# the following standard:
1114
#
1215
# sits_cube(
1316
# source = "HF:<user>",
1417
# collection = "<repository>",
1518
# tiles = "<tile>"
1619
# )
1720
#
18-
# Datasets can hold data cubes of images (as in this example), embeddings,
19-
# or classified maps:
20-
# - embeddings: images named after the bands sits uses for embeddings
21-
# ("EMB00", "EMB01", ...). sits defines how embeddings are stored, so
22-
# these datasets describe no bands at all: how many of them the dataset
23-
# holds is taken from the names of its images, and their resolution from
24-
# the images. A dataset that describes its embedding bands must follow
25-
# the sits definition (see embedding_values in the sits configuration);
26-
# - classified maps: "class_cube: true" and a single band named "CLASS",
27-
# whose "values" associate each pixel value to a label;
28-
# - results produced by sits (e.g., probabilities, classified maps,
29-
# uncertainty), keeping the file names written by sits
30-
# ("<satellite>_<sensor>_<tile>_<start_date>_<end_date>_<band>_<version>"
31-
# followed by the file extension).
32-
# Their bands follow the sits definition of results, so each band only
33-
# informs its resolution, and the labels are declared once:
34-
#
35-
# labels:
36-
# 1: "Cerrado"
37-
# 2: "Forest"
38-
# bands:
39-
# PROBS : &band
40-
# resolution: 231.656
41-
# CLASS : *band
42-
#
43-
# Results are loaded one band at a time (e.g., bands = "probs").
21+
#
22+
# A dataset can hold four types of data cube. Each one is declared in a
23+
# different way:
24+
#
25+
# 1. Images (the type described in this example)
26+
#
27+
# Declare every band of the images, as done below in "bands".
28+
#
29+
# 2. Embeddings
30+
#
31+
# Use the band names sits uses for embeddings in the image names:
32+
# "EMB00", "EMB01", and so on.
33+
#
34+
# Here, bands are optional. If you store the embeddings the way sits
35+
# does, declare nothing: sits reads the band names from the image
36+
# names, and the resolution from the images.
37+
#
38+
# You can still declare the bands, but then they must follow the sits
39+
# definition (see "embedding_values" in the sits configuration).
40+
#
41+
# 3. Classified maps that were not produced by sits
42+
#
43+
# Declare "class_cube: true" and a single band named "CLASS", whose
44+
# "values" associate each pixel value to a label:
45+
#
46+
# class_cube : true
47+
#
48+
# bands:
49+
# CLASS:
50+
# bit_mask : false
51+
# band_name : "CLASS"
52+
# resolution : 231.656
53+
# values :
54+
# 1 : "Cerrado"
55+
# 2 : "Forest"
56+
#
57+
# This is useful to host existing maps that were not produced by sits.
58+
#
59+
# 4. Results produced by sits (e.g., probabilities, classified maps,
60+
# uncertainty)
61+
#
62+
# Keep the names sits writes for its results, which carry the period
63+
# of the classification and the version of the result:
64+
#
65+
# <satellite>_<sensor>_<tile>_<start_date>_<end_date>_<band>_<version>
66+
#
67+
# Bands are named as the results of sits ("PROBS", "BAYES", "CLASS",
68+
# "VARIANCE", "ENTROPY", ...) and can't be mixed with other bands.
69+
#
70+
# sits defines these bands, so each one only informs its resolution,
71+
# and the labels are declared once for the whole collection:
72+
#
73+
# labels:
74+
# 1: "Cerrado"
75+
# 2: "Forest"
76+
#
77+
# bands:
78+
# PROBS : &band
79+
# resolution: 231.656
80+
# CLASS : *band
81+
#
82+
# Results are loaded one band at a time (e.g., bands = "probs").
4483
#
4584
# This example describes the dataset "felipemcarlos/sits_mod13q1_sinop", a
4685
# small crop (255 x 147 pixels) of the MOD13Q1 NDVI product over Sinop
4786
# (Mato Grosso, Brazil), distributed with sits as example data.
48-
4987
satellite : "TERRA"
5088
sensor : "MODIS"
51-
# tiling system of the images. With a grid known to sits (e.g. "MGRS",
52-
# "BDC_MD_V2"), only the tiles that intersect a roi are read; otherwise use
53-
# a label (as sits does for other products, e.g. "STG", "WRS-2",
54-
# "NoTilingSystem")
89+
# You can define any name for the grid system. It will work in the same way as
90+
# in the other sources in sits. However, if the grid system defined is known by
91+
# sits, for instance "MGRS", this will allow users to filter the files loaded
92+
# using tile names of that grid (e.g., "20LMR" in the case of "MGRS")
5593
grid_system : "STG"
5694
dates : "2013 to 2014"
5795

0 commit comments

Comments
 (0)