kaneduan commited on
Commit
6e9b7f5
·
verified ·
1 Parent(s): 14561ab

Fix Quick Start: query_img_path is a PIL Image (Parquet embeds bytes), no os.path.join needed

Browse files
Files changed (1) hide show
  1. README.md +5 -11
README.md CHANGED
@@ -79,23 +79,17 @@ A Bench for evaluating **design patent Freedom-To-Operate (FTO)** retrieval syst
79
 
80
  ```python
81
  from datasets import load_dataset
82
- from PIL import Image
83
- import os
84
 
85
  ds = load_dataset("PatSnap/design-fto-bench", split="test")
86
  print(f"Total samples: {len(ds)}")
87
 
88
  # Inspect one sample
89
  sample = ds[0]
90
- print(sample)
91
-
92
- # Load the query image
93
- # Images are stored under data/image/<query_img_path>
94
- img_path = os.path.join(
95
- "<local_dataset_dir>/data/image",
96
- sample["query_img_path"]
97
- )
98
- # img = Image.open(img_path)
99
 
100
  # Targets are the set of design patents whose images constitute infringement risk
101
  print(sample["target_pns"], sample["target_img_ids"])
 
79
 
80
  ```python
81
  from datasets import load_dataset
 
 
82
 
83
  ds = load_dataset("PatSnap/design-fto-bench", split="test")
84
  print(f"Total samples: {len(ds)}")
85
 
86
  # Inspect one sample
87
  sample = ds[0]
88
+ print(sample["query_pn"], sample["pair_name"])
89
+
90
+ # query_img_path is a PIL Image (bytes embedded in the Parquet, no external lookup needed)
91
+ img = sample["query_img_path"]
92
+ print(f"Query image: {img.size}, mode={img.mode}")
 
 
 
 
93
 
94
  # Targets are the set of design patents whose images constitute infringement risk
95
  print(sample["target_pns"], sample["target_img_ids"])