Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Import necessary libraries for creating a dataset
|
2 |
+
from datasets import load_dataset
|
3 |
+
|
4 |
+
# Load your preprocessed data
|
5 |
+
data = np.load('preprocessed_data.npy', allow_pickle=True)
|
6 |
+
|
7 |
+
# Create a Hugging Face compatible dataset
|
8 |
+
dataset = {
|
9 |
+
'image_path': [item['image_path'] for item in data],
|
10 |
+
'label': [item['label'] for item in data],
|
11 |
+
'image': [item['image'] for item in data]
|
12 |
+
}
|
13 |
+
|
14 |
+
# Create a Dataset object
|
15 |
+
khmer_ocr_dataset = load_dataset('your_custom_dataset_name', data_files=dataset)
|