Datasets:
aegishield
commited on
Commit
•
65891bf
1
Parent(s):
60ca221
fix: dir
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +0 -9
- a.py +44 -46
- images/test/train (107).jpg +3 -0
- images/test/train (115).jpg +3 -0
- images/test/train (126).jpg +3 -0
- images/test/train (141).jpg +3 -0
- images/test/train (157).jpg +3 -0
- images/test/train (172).jpg +3 -0
- images/test/train (173).jpg +3 -0
- images/test/train (180).jpg +3 -0
- images/test/train (197).jpg +3 -0
- images/test/train (201).jpg +3 -0
- images/test/train (21).jpg +3 -0
- images/test/train (221).jpg +3 -0
- images/test/train (227).jpg +3 -0
- images/test/train (229).jpg +3 -0
- images/test/train (244).jpg +3 -0
- images/test/train (245).jpg +3 -0
- images/test/train (25).jpg +3 -0
- images/test/train (251).jpg +3 -0
- images/test/train (258).jpg +3 -0
- images/test/train (266).jpg +3 -0
- images/test/train (269).jpg +3 -0
- images/test/train (280).jpg +3 -0
- images/test/train (283).jpg +3 -0
- images/test/train (287).jpg +3 -0
- images/test/train (289).jpg +3 -0
- images/test/train (29).jpg +3 -0
- images/test/train (290).jpg +3 -0
- images/test/train (292).jpg +3 -0
- images/test/train (306).jpg +3 -0
- images/test/train (336).jpg +3 -0
- images/test/train (345).jpg +3 -0
- images/test/train (355).jpg +3 -0
- images/test/train (362).jpg +3 -0
- images/test/train (366).jpg +3 -0
- images/test/train (369).jpg +3 -0
- images/test/train (37).jpg +3 -0
- images/test/train (399).jpg +3 -0
- images/test/train (402).jpg +3 -0
- images/test/train (410).jpg +3 -0
- images/test/train (53).jpg +3 -0
- images/test/train (59).jpg +3 -0
- images/test/train (66).jpg +3 -0
- images/test/train (93).jpg +3 -0
- images/train/train (1).jpg +3 -0
- images/train/train (10).jpg +3 -0
- images/train/train (100).jpg +3 -0
- images/train/train (102).jpg +3 -0
- images/train/train (103).jpg +3 -0
README.md
CHANGED
@@ -14,15 +14,6 @@ task_categories:
|
|
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
|
|
|
14 |
- image-to-text
|
15 |
task_ids:
|
16 |
- multi-label-classification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
---
|
18 |
|
19 |
# Dataset Card for Balinese Carving Dataset
|
a.py
CHANGED
@@ -2,54 +2,52 @@ import os
|
|
2 |
import shutil
|
3 |
import pandas as pd
|
4 |
|
5 |
-
#
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
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(
|
43 |
-
val_df = pd.read_csv(
|
44 |
-
test_df = pd.read_csv(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
#
|
47 |
-
train_df
|
48 |
-
val_df
|
49 |
-
test_df
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
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_caption.csv'
|
8 |
+
val_csv = 'validation_caption.csv'
|
9 |
+
test_csv = 'test_caption.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 destination path
|
29 |
+
dest_path = os.path.join(destination_folder, os.path.basename(file_name))
|
30 |
+
# Copy the image
|
31 |
+
if os.path.exists(file_name):
|
32 |
+
shutil.copy(file_name, dest_path)
|
33 |
+
|
34 |
+
# Copy the images based on the CSVs
|
35 |
+
copy_images(train_df, train_dir)
|
36 |
+
copy_images(val_df, val_dir)
|
37 |
+
copy_images(test_df, test_dir)
|
38 |
|
39 |
+
# Load the CSV files
|
40 |
+
# train_df = pd.read_csv('train.csv')
|
41 |
+
# val_df = pd.read_csv('validation.csv')
|
42 |
+
# test_df = pd.read_csv('test.csv')
|
43 |
+
|
44 |
+
# # Update file_name with respective image directories
|
45 |
+
# train_df['file_name'] = 'images/train/' + train_df['file_name'].apply(os.path.basename)
|
46 |
+
# val_df['file_name'] = 'images/validation/' + val_df['file_name'].apply(os.path.basename)
|
47 |
+
# test_df['file_name'] = 'images/test/' + test_df['file_name'].apply(os.path.basename)
|
48 |
|
49 |
+
# # Combine all three datasets
|
50 |
+
# combined_df = pd.concat([train_df, val_df, test_df], ignore_index=True)
|
51 |
|
52 |
+
# # Save the combined dataset
|
53 |
+
# combined_df.to_csv('metadata.csv', index=False)
|
images/test/train (107).jpg
ADDED
Git LFS Details
|
images/test/train (115).jpg
ADDED
Git LFS Details
|
images/test/train (126).jpg
ADDED
Git LFS Details
|
images/test/train (141).jpg
ADDED
Git LFS Details
|
images/test/train (157).jpg
ADDED
Git LFS Details
|
images/test/train (172).jpg
ADDED
Git LFS Details
|
images/test/train (173).jpg
ADDED
Git LFS Details
|
images/test/train (180).jpg
ADDED
Git LFS Details
|
images/test/train (197).jpg
ADDED
Git LFS Details
|
images/test/train (201).jpg
ADDED
Git LFS Details
|
images/test/train (21).jpg
ADDED
Git LFS Details
|
images/test/train (221).jpg
ADDED
Git LFS Details
|
images/test/train (227).jpg
ADDED
Git LFS Details
|
images/test/train (229).jpg
ADDED
Git LFS Details
|
images/test/train (244).jpg
ADDED
Git LFS Details
|
images/test/train (245).jpg
ADDED
Git LFS Details
|
images/test/train (25).jpg
ADDED
Git LFS Details
|
images/test/train (251).jpg
ADDED
Git LFS Details
|
images/test/train (258).jpg
ADDED
Git LFS Details
|
images/test/train (266).jpg
ADDED
Git LFS Details
|
images/test/train (269).jpg
ADDED
Git LFS Details
|
images/test/train (280).jpg
ADDED
Git LFS Details
|
images/test/train (283).jpg
ADDED
Git LFS Details
|
images/test/train (287).jpg
ADDED
Git LFS Details
|
images/test/train (289).jpg
ADDED
Git LFS Details
|
images/test/train (29).jpg
ADDED
Git LFS Details
|
images/test/train (290).jpg
ADDED
Git LFS Details
|
images/test/train (292).jpg
ADDED
Git LFS Details
|
images/test/train (306).jpg
ADDED
Git LFS Details
|
images/test/train (336).jpg
ADDED
Git LFS Details
|
images/test/train (345).jpg
ADDED
Git LFS Details
|
images/test/train (355).jpg
ADDED
Git LFS Details
|
images/test/train (362).jpg
ADDED
Git LFS Details
|
images/test/train (366).jpg
ADDED
Git LFS Details
|
images/test/train (369).jpg
ADDED
Git LFS Details
|
images/test/train (37).jpg
ADDED
Git LFS Details
|
images/test/train (399).jpg
ADDED
Git LFS Details
|
images/test/train (402).jpg
ADDED
Git LFS Details
|
images/test/train (410).jpg
ADDED
Git LFS Details
|
images/test/train (53).jpg
ADDED
Git LFS Details
|
images/test/train (59).jpg
ADDED
Git LFS Details
|
images/test/train (66).jpg
ADDED
Git LFS Details
|
images/test/train (93).jpg
ADDED
Git LFS Details
|
images/train/train (1).jpg
ADDED
Git LFS Details
|
images/train/train (10).jpg
ADDED
Git LFS Details
|
images/train/train (100).jpg
ADDED
Git LFS Details
|
images/train/train (102).jpg
ADDED
Git LFS Details
|
images/train/train (103).jpg
ADDED
Git LFS Details
|