PeterAM4 commited on
Commit
c28872f
·
verified ·
1 Parent(s): d06265e

Card: cleaner examples figure and usage

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. assets/examples.jpg +2 -2
README.md CHANGED
@@ -46,25 +46,28 @@ SQuID asks vision-language models to measure satellite images: count objects, co
46
  from datasets import load_dataset
47
 
48
  bench = load_dataset("PeterAM4/SQuID", "benchmark", split="test")
 
49
  ex = bench[0]
50
- ex["image"], ex["mask"] # PIL images (mask is None for NAIP)
51
- ex["question"], ex["answer"] # 'What percentage of the image is agricultural land within 50m of water bodies? (GSD: 0.3m)', '29.32'
 
52
  ```
53
 
54
- Score a prediction:
55
 
56
  ```python
57
  def is_correct(pred, ex):
58
  lo, hi = ex["acceptable_range_lower"], ex["acceptable_range_upper"]
59
- if lo is None: # yes/no (1/0) and connected/fragmented
60
  return str(pred) == ex["answer"]
61
  return lo <= float(pred) <= hi
62
  ```
63
 
64
- The `train` config lists 75,687 questions whose `image` and `mask` are file paths in this repository. Download the files with:
65
 
66
  ```python
67
  from huggingface_hub import snapshot_download
 
68
  snapshot_download("PeterAM4/SQuID", repo_type="dataset", local_dir="data")
69
  ```
70
 
 
46
  from datasets import load_dataset
47
 
48
  bench = load_dataset("PeterAM4/SQuID", "benchmark", split="test")
49
+
50
  ex = bench[0]
51
+ ex["question"] # 'What percentage of the image is agricultural land within 50m of water bodies? (GSD: 0.3m)'
52
+ ex["answer"] # '29.32'
53
+ ex["image"] # PIL image; ex["mask"] is its reference mask (None for NAIP)
54
  ```
55
 
56
+ A numeric answer is correct inside its accepted range; the others must match exactly:
57
 
58
  ```python
59
  def is_correct(pred, ex):
60
  lo, hi = ex["acceptable_range_lower"], ex["acceptable_range_upper"]
61
+ if lo is None: # yes/no (1/0), connected/fragmented
62
  return str(pred) == ex["answer"]
63
  return lo <= float(pred) <= hi
64
  ```
65
 
66
+ The `train` config holds 75,687 questions whose `image` and `mask` are paths in this repository:
67
 
68
  ```python
69
  from huggingface_hub import snapshot_download
70
+
71
  snapshot_download("PeterAM4/SQuID", repo_type="dataset", local_dir="data")
72
  ```
73
 
assets/examples.jpg CHANGED

Git LFS Details

  • SHA256: 2a7171984ef237b3201b46107d5e8e13183ca1c52f6c859eb89cae25d722b696
  • Pointer size: 131 Bytes
  • Size of remote file: 209 kB

Git LFS Details

  • SHA256: a5f304aee7bb07bdc08e972382d9fa8eb41a3ec656a03b743ec53eea772b4b88
  • Pointer size: 131 Bytes
  • Size of remote file: 338 kB