XavierJiezou commited on
Commit
f565899
·
verified ·
1 Parent(s): ebc875d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -63
README.md CHANGED
@@ -11,7 +11,7 @@ tags:
11
  - Cloud
12
  ---
13
 
14
- # Cloud-Adapter-Datasets
15
 
16
  This dataset card aims to describe the datasets used in the [KTDA](https://xavierjiezou.github.io/KTDA/), Knowledge Transfer and Domain Adaptation for
17
  Fine-Grained Remote Sensing Image Segmentation
@@ -34,67 +34,6 @@ unzip grass.zip -d grass
34
  unzip cloud.zip -d l8_biome
35
  ```
36
 
37
- ## Example
38
-
39
- ```python
40
- import os
41
- import zipfile
42
- from huggingface_hub import hf_hub_download
43
-
44
- # Define the dataset repository
45
- repo_id = "XavierJiezou/ktda-datasets"
46
- # Select the zip file of the dataset to download
47
- zip_files = [
48
- "grass.zip",
49
- # "cloud.zip",
50
- ]
51
-
52
- # Define a directory to extract the datasets
53
- output_dir = "cloud_adapter_paper_data"
54
-
55
- # Ensure the output directory exists
56
- os.makedirs(output_dir, exist_ok=True)
57
-
58
- # Step 1: Download and extract each ZIP file
59
- for zip_file in zip_files:
60
- print(f"Downloading {zip_file}...")
61
- # Download the ZIP file from Hugging Face Hub
62
- zip_path = hf_hub_download(repo_id=repo_id, filename=zip_file, repo_type="dataset")
63
-
64
- # Extract the ZIP file
65
- extract_path = os.path.join(output_dir, zip_file.replace(".zip", ""))
66
- with zipfile.ZipFile(zip_path, "r") as zip_ref:
67
- print(f"Extracting {zip_file} to {extract_path}...")
68
- zip_ref.extractall(extract_path)
69
-
70
- # Step 2: Explore the extracted datasets
71
- # Example: Load and display the contents of the "hrc_whu" dataset
72
- dataset_path = os.path.join(output_dir, "hrc_whu")
73
- train_images_path = os.path.join(dataset_path, "img_dir", "train")
74
- train_annotations_path = os.path.join(dataset_path, "ann_dir", "train")
75
-
76
- # Display some files in the training set
77
- print("Training Images:", os.listdir(train_images_path)[:5])
78
- print("Training Annotations:", os.listdir(train_annotations_path)[:5])
79
-
80
- # Example: Load and display an image and its annotation
81
- from PIL import Image
82
-
83
- # Load an example image and annotation
84
- image_path = os.path.join(train_images_path, os.listdir(train_images_path)[0])
85
- annotation_path = os.path.join(train_annotations_path, os.listdir(train_annotations_path)[0])
86
-
87
- # Open and display the image
88
- image = Image.open(image_path)
89
- annotation = Image.open(annotation_path)
90
-
91
- print("Displaying the image...")
92
- image.show()
93
-
94
- print("Displaying the annotation...")
95
- annotation.show()
96
- ```
97
-
98
  ## Source Data
99
 
100
  - l8_biome: https://landsat.usgs.gov/landsat-8-cloud-cover-assessment-validation-data
@@ -102,7 +41,6 @@ annotation.show()
102
  ## Citation
103
 
104
  ```bib
105
-
106
  @article{l8_biome,
107
  title = {Cloud detection algorithm comparison and validation for operational Landsat data products},
108
  journal = {Remote Sensing of Environment},
 
11
  - Cloud
12
  ---
13
 
14
+ # KTDA-Datasets
15
 
16
  This dataset card aims to describe the datasets used in the [KTDA](https://xavierjiezou.github.io/KTDA/), Knowledge Transfer and Domain Adaptation for
17
  Fine-Grained Remote Sensing Image Segmentation
 
34
  unzip cloud.zip -d l8_biome
35
  ```
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ## Source Data
38
 
39
  - l8_biome: https://landsat.usgs.gov/landsat-8-cloud-cover-assessment-validation-data
 
41
  ## Citation
42
 
43
  ```bib
 
44
  @article{l8_biome,
45
  title = {Cloud detection algorithm comparison and validation for operational Landsat data products},
46
  journal = {Remote Sensing of Environment},