Commit ·
cc35b6d
0
Parent(s):
Duplicate from KLOBIP/OBIMD
Browse filesCo-authored-by: yeyu <ghost0hand@users.noreply.huggingface.co>
- .gitattributes +63 -0
- Hierarchical Character Metadata Supplement/Main-character.json +0 -0
- Hierarchical Character Metadata Supplement/Sub-character Images.zip +3 -0
- Hierarchical Character Metadata Supplement/Sub-character to Glyph Code Point Mapping.xlsx +3 -0
- Hierarchical Character Metadata Supplement/Sub-character to Main-character Mapping.xlsx +0 -0
- LICENSE +3 -0
- OBIMD.py +88 -0
- README.md +91 -0
- data.json +3 -0
- facsimile.zip +3 -0
- figures/data structure.png +3 -0
- figures/overview.png +3 -0
- figures/pipeline for constructing.png +3 -0
- rubbing.zip +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
data.json filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
Sub-character[[:space:]]to[[:space:]]Transcription[[:space:]]Mapping.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
Hierarchical[[:space:]]Character[[:space:]]Metadata[[:space:]]Supplement/Sub-character[[:space:]]to[[:space:]]Transcription[[:space:]]Mapping.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
Hierarchical[[:space:]]Character[[:space:]]Metadata[[:space:]]Supplement/Sub-character[[:space:]]to[[:space:]]Glyph[[:space:]]Code[[:space:]]Point[[:space:]]Mapping.xlsx filter=lfs diff=lfs merge=lfs -text
|
Hierarchical Character Metadata Supplement/Main-character.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Hierarchical Character Metadata Supplement/Sub-character Images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55c53522e0d328ffcf7ff9da5a963c1193d03bae9f841a4028fbe4d0427f39fb
|
| 3 |
+
size 40436910
|
Hierarchical Character Metadata Supplement/Sub-character to Glyph Code Point Mapping.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8e0bd8b810565c5f2642f40d534aa4f35976d1edc27ee96829c151060aeb76c
|
| 3 |
+
size 668208
|
Hierarchical Character Metadata Supplement/Sub-character to Main-character Mapping.xlsx
ADDED
|
Binary file (71.3 kB). View file
|
|
|
LICENSE
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Creative Commons Attribution 4.0 International
|
| 2 |
+
|
| 3 |
+
You must give appropriate credit to the author(s).
|
OBIMD.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
from datasets import DatasetInfo, BuilderConfig, GeneratorBasedBuilder, SplitGenerator, \
|
| 4 |
+
Split, Features, Value, Sequence, Image
|
| 5 |
+
import zipfile
|
| 6 |
+
|
| 7 |
+
class OBIMDConfig(BuilderConfig):
|
| 8 |
+
def __init__(self, **kwargs):
|
| 9 |
+
super().__init__(version="1.0.0", **kwargs)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class OBIMDDataset(GeneratorBasedBuilder):
|
| 13 |
+
BUILDER_CONFIGS = [
|
| 14 |
+
OBIMDConfig(name="default", description="Oracle bone OBIMD dataset."),
|
| 15 |
+
]
|
| 16 |
+
|
| 17 |
+
def _info(self):
|
| 18 |
+
return DatasetInfo(
|
| 19 |
+
description="Paired images of oracle bone rubbings and facsimiles with annotations.",
|
| 20 |
+
features=Features({
|
| 21 |
+
"Facsimile": Image(),
|
| 22 |
+
"Rubbing": Image(),
|
| 23 |
+
"RubbingName": Value("string"),
|
| 24 |
+
"RecordUtilSentenceGroupVoList": Sequence({
|
| 25 |
+
"GroupCategory": Value("string"),
|
| 26 |
+
"RecordUtilOracleCharVoList": Sequence({
|
| 27 |
+
"Position": Value("string"),
|
| 28 |
+
"OrderNumber": Value("int32"),
|
| 29 |
+
"SeatFont": Value("int32"),
|
| 30 |
+
"Mark": Value("int32"),
|
| 31 |
+
"Label": Value("string"),
|
| 32 |
+
"SubLabel": Value("string"),
|
| 33 |
+
}),
|
| 34 |
+
}),
|
| 35 |
+
}),
|
| 36 |
+
supervised_keys=None,
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
def _split_generators(self, dl_manager):
|
| 40 |
+
if os.path.exists(self.base_path):
|
| 41 |
+
data_dir = self.base_path
|
| 42 |
+
else:
|
| 43 |
+
data_dir = dl_manager.download_and_extract(self.config.data_dir or ".")
|
| 44 |
+
|
| 45 |
+
return [
|
| 46 |
+
SplitGenerator(
|
| 47 |
+
name=Split.TRAIN,
|
| 48 |
+
gen_kwargs={
|
| 49 |
+
"filepath": os.path.join(data_dir, "data.json"),
|
| 50 |
+
"base_path": data_dir,
|
| 51 |
+
},
|
| 52 |
+
),
|
| 53 |
+
]
|
| 54 |
+
|
| 55 |
+
def _generate_examples(self, filepath, base_path):
|
| 56 |
+
with open(filepath, encoding="utf-8") as f:
|
| 57 |
+
data = json.load(f)
|
| 58 |
+
with zipfile.ZipFile(os.path.join(base_path, "rubbing.zip"), 'r') as rubbing_ref:
|
| 59 |
+
with zipfile.ZipFile(os.path.join(base_path, "facsimile.zip"), 'r') as facsimile_ref:
|
| 60 |
+
for idx, item in enumerate(data):
|
| 61 |
+
|
| 62 |
+
with rubbing_ref.open(item["Rubbing"]) as file:
|
| 63 |
+
rubbing_content = file.read()
|
| 64 |
+
with facsimile_ref.open(item["Facsimile"]) as file:
|
| 65 |
+
facsimile_content = file.read()
|
| 66 |
+
|
| 67 |
+
yield idx, {
|
| 68 |
+
"Facsimile": facsimile_content,
|
| 69 |
+
"Rubbing": rubbing_content,
|
| 70 |
+
"RubbingName": item["RubbingName"],
|
| 71 |
+
"RecordUtilSentenceGroupVoList": [
|
| 72 |
+
{
|
| 73 |
+
"GroupCategory": group["GroupCategory"],
|
| 74 |
+
"RecordUtilOracleCharVoList": [
|
| 75 |
+
{
|
| 76 |
+
"Position": char["Position"],
|
| 77 |
+
"OrderNumber": char["OrderNumber"],
|
| 78 |
+
"SeatFont": char["SeatFont"],
|
| 79 |
+
"Mark": char["Mark"],
|
| 80 |
+
"Label": char["Label"],
|
| 81 |
+
"SubLabel": char["SubLabel"],
|
| 82 |
+
}
|
| 83 |
+
for char in group["RecordUtilOracleCharVoList"]
|
| 84 |
+
],
|
| 85 |
+
}
|
| 86 |
+
for group in item["RecordUtilSentenceGroupVoList"]
|
| 87 |
+
],
|
| 88 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
---
|
| 4 |
+
# Oracle Bone Inscriptions Multi-modal Dataset (OBIMD)
|
| 5 |
+
|
| 6 |
+
## Dataset Overview
|
| 7 |
+
|
| 8 |
+
The Oracle Bone Inscriptions Multi-modal Dataset (OBIMD) is the first large-scale corpus providing pixel-aligned rubbings and facsimiles, character-level annotations, and sentence-level transcriptions and reading sequences for oracle bone inscription (OBI) research. This dataset enables multi-modal learning across visual, structural, and linguistic dimensions, laying the foundation for end-to-end OBI recognition and interpretation.
|
| 9 |
+
<p align="center">
|
| 10 |
+
<img src="figures/overview.png" alt="图片" width="80%" height="80%">
|
| 11 |
+
</p>
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
## Dataset Statistics
|
| 15 |
+
|
| 16 |
+
- Total OBI images: 10,077 across five Shang Dynasty phases
|
| 17 |
+
- Annotated characters: 93,652
|
| 18 |
+
- Missing character positions: 21,667 (due to fragmentation)
|
| 19 |
+
- Sentences: 21,941 syntactically validated
|
| 20 |
+
- Non-sentential elements: 4,192
|
| 21 |
+
|
| 22 |
+
## Data Structure
|
| 23 |
+
|
| 24 |
+
The dataset follows a three-level hierarchy:
|
| 25 |
+
|
| 26 |
+
1. Image-level: Contains rubbing and facsimile pairs
|
| 27 |
+
2. Sentence-level: Groups characters into meaningful units
|
| 28 |
+
3. Character-level: Detailed annotations for each character
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
## Data Fields
|
| 32 |
+
|
| 33 |
+
|Field Name|Description|Example|
|
| 34 |
+
|-|-|-|
|
| 35 |
+
|Facsimile|Path to facsimile image|facsimile/h00002.jpg|
|
| 36 |
+
|Rubbing|Path to rubbing image|rubbing/h00002.jpg|
|
| 37 |
+
|RubbingName|Short identifier|H2|
|
| 38 |
+
|GroupCategory|Sentence type|InscriptionSentence1|
|
| 39 |
+
|Position|Bounding box (x,y,w,h)|558,581,80,218|
|
| 40 |
+
|OrderNumber|Character order in sentence|5|
|
| 41 |
+
|Label|Main character label|xkubtjk815|
|
| 42 |
+
|SubLabel|Secondary label|xkubtjk815|
|
| 43 |
+
|SeatFont|Placeholder indicator|0|
|
| 44 |
+
|Mark|Special marker|-1|
|
| 45 |
+
|
| 46 |
+
## Data Modalities
|
| 47 |
+
|
| 48 |
+
1. Rubbing images: Original scanned images of oracle bones
|
| 49 |
+
2. Facsimile images: Expert reconstructions aligned with rubbings
|
| 50 |
+
3. Character annotations: Bounding boxes and classifications
|
| 51 |
+
4. Sentence groupings: Semantic organization of characters
|
| 52 |
+
5. Reading sequences: Order of characters within sentences
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+
## Hierarchical Character Metadata Supplement
|
| 56 |
+
|
| 57 |
+
This folder contains supporting materials for the character hierarchy used in OBIMD. It includes:
|
| 58 |
+
|
| 59 |
+
1. Sub-character Images: Images of sub-character variants, stored in a two-level folder structure. The top-level directory is named by the main character UID, and each subfolder is named by the corresponding sub-character UID.
|
| 60 |
+
2. Sub-character to Glyph Code Point Mapping (XLSX): Maps each sub-character UID to the platform-specific glyph code point used by the Oracular Digital Platform font.
|
| 61 |
+
3. Sub-character to Main-character Mapping (XLSX): Maps each sub-character UID to its parent main character UID in the Oracular Digital Platform.
|
| 62 |
+
4. Main-character → Reference Modern Character (JSON): For each main-character UID, the JSON provides a platform-provided reference modern Chinese character (a standardized surrogate used for lookup and navigation). Note: this mapping is for reference only and is not intended as a final philological interpretation, since oracle bone inscriptions decipherment remains ongoing.
|
| 63 |
+
|
| 64 |
+
## Usage Notes
|
| 65 |
+
|
| 66 |
+
The dataset is designed to support various research tasks:
|
| 67 |
+
|
| 68 |
+
- Character detection and recognition
|
| 69 |
+
- Sentence-level character clustering
|
| 70 |
+
- Character reordering within sentences
|
| 71 |
+
- Multi-modal analysis (rubbing vs. facsimile)
|
| 72 |
+
|
| 73 |
+
## License
|
| 74 |
+
|
| 75 |
+
This model is licensed under CC-BY 4.0.
|
| 76 |
+
|
| 77 |
+
## Citation
|
| 78 |
+
|
| 79 |
+
If you use this dataset in your research, please cite:
|
| 80 |
+
|
| 81 |
+
<!-- ```bibtex
|
| 82 |
+
@article{li2024obimd,
|
| 83 |
+
title={Oracle Bone Inscriptions Multi-modal Dataset},
|
| 84 |
+
author={Li, Bang and Luo, Donghao and Liang, Yujie and others},
|
| 85 |
+
journal={arXiv preprint arXiv:2407.03900},
|
| 86 |
+
year={2024},
|
| 87 |
+
url={https://doi.org/10.48550/arXiv.2407.03900}
|
| 88 |
+
}
|
| 89 |
+
```
|
| 90 |
+
## License
|
| 91 |
+
The dataset is released for academic research purposes only. Commercial use requires special permission from the authors. -->
|
data.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b504b0d4e7a0126d494c161f5445c5ee4225659ff5e94182685fce35d261aa19
|
| 3 |
+
size 41732948
|
facsimile.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1544e34ee1a6a34fc0a83475a227fd2141a67293f795eaa3c52760fedb50b0e
|
| 3 |
+
size 210800641
|
figures/data structure.png
ADDED
|
Git LFS Details
|
figures/overview.png
ADDED
|
Git LFS Details
|
figures/pipeline for constructing.png
ADDED
|
Git LFS Details
|
rubbing.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d07dca94e94c2d17edd7fa25be72b5673161c0c2d03dac4d2c094e5341b7747
|
| 3 |
+
size 558367972
|