aegishield commited on
Commit
60ca221
1 Parent(s): 98ce35e
This view is limited to 50 files because it contains too many changes.   See raw diff
README.md CHANGED
@@ -14,6 +14,15 @@ task_categories:
14
  - image-to-text
15
  task_ids:
16
  - multi-label-classification
 
 
 
 
 
 
 
 
 
17
  ---
18
 
19
  # Dataset Card for Balinese Carving Dataset
 
14
  - image-to-text
15
  task_ids:
16
  - multi-label-classification
17
+ configs:
18
+ - config_name: default
19
+ data_files:
20
+ - split: train
21
+ path: "train.csv"
22
+ - split: test
23
+ path: "test.csv"
24
+ - split: validation
25
+ path: "validation.csv"
26
  ---
27
 
28
  # Dataset Card for Balinese Carving Dataset
a.py CHANGED
@@ -1,49 +1,55 @@
1
  import os
2
- import json
3
- from datasets import GeneratorBasedBuilder, SplitGenerator, DatasetInfo, Split, Features, Image, Value, Sequence, ClassLabel
4
-
5
- class BalineseCarvingDataset(GeneratorBasedBuilder):
6
- # Version of the dataset
7
- VERSION = "1.0.0"
8
-
9
- def _info(self):
10
- return DatasetInfo(
11
- features=Features({
12
- 'image': Image(), # Image field
13
- 'image_id': Value('string'), # Unique ID for each image
14
- 'carving_classes': Sequence(ClassLabel(names=['Barong', 'Punggel', 'Keketusan', 'Gajah', 'Cina', 'Goak'])), # Multi-label classification
15
- 'material': Value('string'), # Material description
16
- 'color': Value('string'), # Color description
17
- })
18
- )
19
-
20
- def _split_generators(self, dl_manager):
21
- # Define the dataset split (train, validation, test)
22
- json_path = dl_manager.download_and_extract("path/to/classification_trainval_ukiran.json")
23
- image_dir = dl_manager.download_and_extract("path/to/images")
24
-
25
- return [
26
- SplitGenerator(
27
- name=Split.TRAIN, # Use Split.TRAIN for train split
28
- gen_kwargs={
29
- "json_path": json_path,
30
- "image_dir": image_dir
31
- }
32
- )
33
- ]
34
-
35
- def _generate_examples(self, json_path, image_dir):
36
- # Load JSON data
37
- with open(json_path, 'r') as f:
38
- data = json.load(f)
39
-
40
- # Yield data
41
- for idx, item in enumerate(data):
42
- image_path = os.path.join(image_dir, item['File_Name'])
43
- yield idx, {
44
- 'image': image_path,
45
- 'image_id': item['Image_ID'],
46
- 'carving_classes': item['Carving_Classes'],
47
- 'material': item['Material'],
48
- 'color': item['Color']
49
- }
 
 
 
 
 
 
 
1
  import os
2
+ import shutil
3
+ import pandas as pd
4
+
5
+ # # Define the image folder and CSV files
6
+ # image_folder = "images/"
7
+ # train_csv = 'train.csv'
8
+ # val_csv = 'validation.csv'
9
+ # test_csv = 'test.csv'
10
+
11
+ # # Load the CSV files
12
+ # train_df = pd.read_csv(train_csv)
13
+ # val_df = pd.read_csv(val_csv)
14
+ # test_df = pd.read_csv(test_csv)
15
+
16
+ # # Create directories for train, test, validation images
17
+ # train_dir = 'images/train/'
18
+ # val_dir = 'images/validation/'
19
+ # test_dir = 'images/test/'
20
+
21
+ # os.makedirs(train_dir, exist_ok=True)
22
+ # os.makedirs(val_dir, exist_ok=True)
23
+ # os.makedirs(test_dir, exist_ok=True)
24
+
25
+ # # Define a function to copy images to the respective folder
26
+ # def copy_images(df, destination_folder):
27
+ # for file_name in df['file_name']:
28
+ # # Construct the full path for the image
29
+ # src_path = os.path.join(image_folder, file_name)
30
+ # # Construct the destination path
31
+ # dest_path = os.path.join(destination_folder, os.path.basename(file_name))
32
+ # # Copy the image
33
+ # if os.path.exists(src_path):
34
+ # shutil.copy(src_path, dest_path)
35
+
36
+ # # Copy the images based on the CSVs
37
+ # copy_images(train_df, train_dir)
38
+ # copy_images(val_df, val_dir)
39
+ # copy_images(test_df, test_dir)
40
+
41
+ # Load the CSV files
42
+ train_df = pd.read_csv('train.csv')
43
+ val_df = pd.read_csv('validation.csv')
44
+ test_df = pd.read_csv('test.csv')
45
+
46
+ # Update file_name with respective image directories
47
+ train_df['file_name'] = 'images/train/' + train_df['file_name'].apply(os.path.basename)
48
+ val_df['file_name'] = 'images/validation/' + val_df['file_name'].apply(os.path.basename)
49
+ test_df['file_name'] = 'images/test/' + test_df['file_name'].apply(os.path.basename)
50
+
51
+ # Combine all three datasets
52
+ combined_df = pd.concat([train_df, val_df, test_df], ignore_index=True)
53
+
54
+ # Save the combined dataset
55
+ combined_df.to_csv('metadata.csv', index=False)
images/train (1).jpg DELETED

Git LFS Details

  • SHA256: 009b6e52712cbf144e275d35a055231b49a271afad6a4714b01b7db33e626bf8
  • Pointer size: 131 Bytes
  • Size of remote file: 326 kB
images/train (10).jpg DELETED

Git LFS Details

  • SHA256: 34e682e5d6e5b648f6f24a71f34fa025e92bcc7d5df96efe7779597549f93026
  • Pointer size: 131 Bytes
  • Size of remote file: 348 kB
images/train (100).jpg DELETED

Git LFS Details

  • SHA256: 93b0039df4cba33aefb69e8029c551e95aad6c42b5818a1ae285cd37f9653d22
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
images/train (101).jpg DELETED

Git LFS Details

  • SHA256: dafd2d7651c2d571e08b8beadbc82853fdb58a99d0dcf26b3f993f83a2ffdb7d
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
images/train (102).jpg DELETED

Git LFS Details

  • SHA256: b164e882d2211d17557f54a625a8914c403df383288ae97cfedac2802cc0af96
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
images/train (103).jpg DELETED

Git LFS Details

  • SHA256: a471f439f0457ea2fb151005f03d135d6a15b93422b2afdfd8b46768e3452fd6
  • Pointer size: 131 Bytes
  • Size of remote file: 227 kB
images/train (104).jpg DELETED

Git LFS Details

  • SHA256: 19f054dab827a34e0e52c2a5b4ebd3eb6b65e8085d6a58e44fb08bac2236f3b9
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (105).jpg DELETED

Git LFS Details

  • SHA256: be332e0105cddf81b70b985452d96f493817ac7e67938984840796ba018a467a
  • Pointer size: 131 Bytes
  • Size of remote file: 225 kB
images/train (106).jpg DELETED

Git LFS Details

  • SHA256: 0f17f2002dbebe9906e6f7852c4ccf8979be6954f1f49f56ac85419e3587216b
  • Pointer size: 131 Bytes
  • Size of remote file: 226 kB
images/train (107).jpg DELETED

Git LFS Details

  • SHA256: 795952ad985dab8b8a96c6e7cf55ac91f2ef0ccc457ea9dc6c43acd31d6cf9f8
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
images/train (108).jpg DELETED

Git LFS Details

  • SHA256: 94a510da573757214f25d2d80931e25ff9c4cfb6d8d5937a84c9490609e6a9d6
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (109).jpg DELETED

Git LFS Details

  • SHA256: eae73b6bd2383b161c25719c1ce1129438eb811573b2cc09e9cddab5ddd3e134
  • Pointer size: 131 Bytes
  • Size of remote file: 225 kB
images/train (11).jpg DELETED

Git LFS Details

  • SHA256: 2dbedfe04d81acda8c9f802826f8760c5d4a2488fea53f4bc138335b1b21a4fd
  • Pointer size: 131 Bytes
  • Size of remote file: 354 kB
images/train (110).jpg DELETED

Git LFS Details

  • SHA256: c93247932105ef9f5175ca488fea5099f36eae3e78ad36455f0358361973cd5b
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
images/train (111).jpg DELETED

Git LFS Details

  • SHA256: bd855afb92414589c5a3af420a0a48c87670f44066cd54dda2360a0b413cc501
  • Pointer size: 131 Bytes
  • Size of remote file: 225 kB
images/train (112).jpg DELETED

Git LFS Details

  • SHA256: ce2061beb472bc617a057fc4ec838e9d08887f1dcaff9c08e7c16d042fd15af5
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
images/train (113).jpg DELETED

Git LFS Details

  • SHA256: 517631871805741bcd8f34a1f30342ab65236abffd55f410467e6f48a0a63bb1
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
images/train (114).jpg DELETED

Git LFS Details

  • SHA256: b71f22e557ae2b27b51585ea0f4e78da1607d290545e5c93aa14d3f89e61fc9f
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (115).jpg DELETED

Git LFS Details

  • SHA256: 477e64558bb8452cd6ccb29a36ba36487535e8e3e8e03acac69db7551d0ec8f2
  • Pointer size: 131 Bytes
  • Size of remote file: 220 kB
images/train (116).jpg DELETED

Git LFS Details

  • SHA256: 78fb880eeb058e47593354052efeedc66baa53c5a3853a488a2d434749757f50
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
images/train (117).jpg DELETED

Git LFS Details

  • SHA256: 7e964dff36131e28a3466e742e00b0f39ff7d48f529637a9d77591f95d860a96
  • Pointer size: 131 Bytes
  • Size of remote file: 221 kB
images/train (118).jpg DELETED

Git LFS Details

  • SHA256: 2a4fe0d921622abc1d3be42a21e020587ec39c59726dd68b853072bdf848fa03
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
images/train (119).jpg DELETED

Git LFS Details

  • SHA256: b394a8475a697a71ab79a64ef394e95f1eb1bc6bfb8ef63ecdb9ad31e042a7ea
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
images/train (12).jpg DELETED

Git LFS Details

  • SHA256: bdb60aac9919dc9bc7dd2339607751695dfa9be6e2dea2a08c95369fde97441f
  • Pointer size: 131 Bytes
  • Size of remote file: 340 kB
images/train (120).jpg DELETED

Git LFS Details

  • SHA256: 17e4213483efc7a0815163147c6b0815e6ca393742a0f0234e8eeed5b9966553
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
images/train (121).jpg DELETED

Git LFS Details

  • SHA256: eb14ef4bbdcc2d0bc7dc8650aa11ddbf737aadda3a5aa6187025e1757167590c
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (122).jpg DELETED

Git LFS Details

  • SHA256: 7a76747bd1a470bc1b22d70f7d18a096437cae4492b64870c5c94e37bfa924c0
  • Pointer size: 131 Bytes
  • Size of remote file: 220 kB
images/train (123).jpg DELETED

Git LFS Details

  • SHA256: 25aa542f12e512f3fb2fa3e4a003cad878f2289265c42dfec726902669cd4c3a
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (124).jpg DELETED

Git LFS Details

  • SHA256: 506286112973cc13e964541fec10e90793831bfeba58ef4e3d872a93dce62c61
  • Pointer size: 131 Bytes
  • Size of remote file: 221 kB
images/train (125).jpg DELETED

Git LFS Details

  • SHA256: 375a1743ae3a7717e43b8189a2f00c43c2a60cd3cdf463f02599d5653a03de32
  • Pointer size: 131 Bytes
  • Size of remote file: 221 kB
images/train (126).jpg DELETED

Git LFS Details

  • SHA256: 87d0c8b862738f1a572a9b08f6a43d875d1b4d65d20899de1cc52081303c697e
  • Pointer size: 131 Bytes
  • Size of remote file: 221 kB
images/train (127).jpg DELETED

Git LFS Details

  • SHA256: e57efb82b0f1e1d30b42df0b8c2defa924f793ceabe9cd0add95fa34f79b0ca4
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (128).jpg DELETED

Git LFS Details

  • SHA256: 350585442d8e8381c064878dae9e3c94f3c5999b768f1ebbc836a31aa6771e18
  • Pointer size: 131 Bytes
  • Size of remote file: 218 kB
images/train (129).jpg DELETED

Git LFS Details

  • SHA256: cbef3da3e98fbfada38fbcb499582995a8bdf97d186d667849590e98d5f6973a
  • Pointer size: 131 Bytes
  • Size of remote file: 220 kB
images/train (13).jpg DELETED

Git LFS Details

  • SHA256: 9901b43401ed9e6e4a3c8e08bd47c93bad33290e5856dedb352d4bfb53fd1c6e
  • Pointer size: 131 Bytes
  • Size of remote file: 340 kB
images/train (130).jpg DELETED

Git LFS Details

  • SHA256: 1c3c86b5346a03cf6da84019c74df2f07cb48b818ce519f58103f59b555003c8
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
images/train (131).jpg DELETED

Git LFS Details

  • SHA256: 76e1d7d1e9f4045be2dd4b13ce7eb9d9963e44ef3ccc35f896b51ea43f1aebc5
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/train (132).jpg DELETED

Git LFS Details

  • SHA256: 09adaf7b19ec6d4837c7c67551d15efd4386256a888d4896d53c692b823b0c13
  • Pointer size: 131 Bytes
  • Size of remote file: 221 kB
images/train (133).jpg DELETED

Git LFS Details

  • SHA256: 67a58c0722779994625d49a8fe79c2aac0a5c18306c1faff20d61f14cb022b54
  • Pointer size: 131 Bytes
  • Size of remote file: 218 kB
images/train (134).jpg DELETED

Git LFS Details

  • SHA256: 8cc11518c261b59b62d250a0d4ad4037d638feb6e01ca99d9ec7b98012706262
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
images/train (135).jpg DELETED

Git LFS Details

  • SHA256: 5440a274cd22fe455bf3bdb5e5f7550a118baa5bd815ce28f13b0da4af04509d
  • Pointer size: 131 Bytes
  • Size of remote file: 217 kB
images/train (136).jpg DELETED

Git LFS Details

  • SHA256: 7a3526f965438a778d29a5e8950a1b0933013b2d8e4a60a1f967aa3f392e7fb4
  • Pointer size: 131 Bytes
  • Size of remote file: 357 kB
images/train (137).jpg DELETED

Git LFS Details

  • SHA256: 4d3b39e6d1e98eb8321cac7c297cb5ad3231711f022942167ef7b072b38174d0
  • Pointer size: 131 Bytes
  • Size of remote file: 355 kB
images/train (138).jpg DELETED

Git LFS Details

  • SHA256: e14967ef7ba41e4d41b3916e5860b692e8948aeaebdc81f6f2324806a13202c5
  • Pointer size: 131 Bytes
  • Size of remote file: 351 kB
images/train (139).jpg DELETED

Git LFS Details

  • SHA256: 224783409942fe67c94e0c92f8b58ace716dff7ebcd7ac03838e3ca2d56a35cc
  • Pointer size: 131 Bytes
  • Size of remote file: 338 kB
images/train (14).jpg DELETED

Git LFS Details

  • SHA256: e9917abb8b2767bd47117e7051bd39ada58452b886f0b74eef16fb2c483a56f3
  • Pointer size: 131 Bytes
  • Size of remote file: 348 kB
images/train (140).jpg DELETED

Git LFS Details

  • SHA256: 02d0174568e4c2e45ffe28a7b18e6bbfd2ebdf9e69fec52d1eccef61384b4baf
  • Pointer size: 131 Bytes
  • Size of remote file: 342 kB
images/train (141).jpg DELETED

Git LFS Details

  • SHA256: efa02359e0952900de4dd0f36d61c6a6a5c8914e4eab131e8594c4ca8a335a81
  • Pointer size: 131 Bytes
  • Size of remote file: 341 kB