jherng commited on
Commit
0a3e21f
1 Parent(s): 266fee3

Edit dataset loading script

Browse files
Files changed (2) hide show
  1. test.py +4 -0
  2. xd-violence.py +4 -3
test.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+ ds = load_dataset("jherng/xd-violence", name="video", split="train")
4
+ print(ds)
xd-violence.py CHANGED
@@ -19,13 +19,13 @@ The dataset is downloaded from the authors' website (https://roc-ng.github.io/XD
19
  is just to make it easier for my own project to use this dataset. Please cite the original paper if you use this dataset.
20
  """
21
 
22
- _NAME = "xd_violence"
23
 
24
  _HOMEPAGE = f"https://huggingface.co/datasets/jherng/{_NAME}"
25
 
26
  _LICENSE = "MIT"
27
 
28
- _URL = f"https://huggingface.co/datasets/jherng/{_NAME}/resolve/main/"
29
 
30
 
31
  class XDViolenceConfig(datasets.BuilderConfig):
@@ -126,7 +126,8 @@ class Squad(datasets.GeneratorBasedBuilder):
126
 
127
  train_list_fpath = dl_manager.download_and_extract(urllib.parse.urljoin(_URL, "train_list.txt"))
128
  test_ann_fpath = dl_manager.download_and_extract(urllib.parse.urljoin(_URL, "test_annotations.txt"))
129
-
 
130
  return [
131
  datasets.SplitGenerator(
132
  name=datasets.Split.TRAIN,
 
19
  is just to make it easier for my own project to use this dataset. Please cite the original paper if you use this dataset.
20
  """
21
 
22
+ _NAME = "xd-violence"
23
 
24
  _HOMEPAGE = f"https://huggingface.co/datasets/jherng/{_NAME}"
25
 
26
  _LICENSE = "MIT"
27
 
28
+ _URL = f"https://huggingface.co/datasets/jherng/{_NAME}/resolve/main/data"
29
 
30
 
31
  class XDViolenceConfig(datasets.BuilderConfig):
 
126
 
127
  train_list_fpath = dl_manager.download_and_extract(urllib.parse.urljoin(_URL, "train_list.txt"))
128
  test_ann_fpath = dl_manager.download_and_extract(urllib.parse.urljoin(_URL, "test_annotations.txt"))
129
+ print(f"{train_list_fpath=}")
130
+ print(f"{test_ann_fpath=}")
131
  return [
132
  datasets.SplitGenerator(
133
  name=datasets.Split.TRAIN,