Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: UnicodeDecodeError
Message: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1855, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/text/text.py", line 73, in _generate_tables
batch = f.read(self.config.chunksize)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 827, in read_with_retries
out = read(*args, **kwargs)
File "/usr/local/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1438, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1050, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 925, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1001, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1742, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1898, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string |
|---|
from dds_cloudapi_sdk import Config
|
from dds_cloudapi_sdk import Client
|
from dds_cloudapi_sdk.tasks.v2_task import V2Task
|
token = "Your API Token Here"
|
config = Config(token)
|
client = Client(config)
|
def read_text_prompts(txt_dir):
|
txt_files = [f for f in os.listdir(txt_dir) if f.endswith('.txt')]
|
video_to_prompt = {}
|
for txt_file in txt_files:
|
video_name = os.path.splitext(txt_file)[0]
|
with open(os.path.join(txt_dir, txt_file), 'r') as f:
|
content = f.read()
|
content = content.replace('\n', '.')
|
content = content.replace('_', ' ')
|
objects = content.split('.')
|
if objects:
|
text_prompt = '.'.join(objects)
|
else:
|
print(f"warning!")
|
video_to_prompt[video_name] = text_prompt
|
return video_to_prompt
|
txt_dir = '/data/users/dongnuan_cai/GPT_extract/music_avqa/music_avqa_filtered'
|
video_to_prompt = read_text_prompts(txt_dir)
|
subdirs = [d for d in os.listdir(base_image_dir) if os.path.isdir(os.path.join(base_image_dir, d))]
|
num_subdirs = len(subdirs)
|
with tqdm(total=num_subdirs, desc="Processing Subdirectories") as pbar_subdirs:
|
for subdir in subdirs:
|
subdir_path = os.path.join(base_image_dir, subdir)
|
if os.path.isdir(subdir_path) and subdir in video_to_prompt:
|
text_prompt = video_to_prompt[subdir]
|
output_subdir = os.path.join(output_base_dir, subdir)
|
os.makedirs(output_subdir, exist_ok=True)
|
txt_output_subdir = os.path.join(output_subdir, "txt_files")
|
os.makedirs(txt_output_subdir, exist_ok=True)
|
image_files = [f for f in os.listdir(subdir_path) if f.startswith("frame_") and f.endswith(".jpg")]
|
num_files = len(image_files)
|
with tqdm(total=num_files, desc=f"Processing {subdir}") as pbar_files:
|
for filename in image_files:
|
input_image_path = os.path.join(subdir_path, filename)
|
txt_output_path = os.path.join(txt_output_subdir, os.path.splitext(filename)[0] + ".txt")
|
if os.path.exists(txt_output_path) and os.path.exists(txt_output_path):
|
pbar_files.update(1)
|
continue
|
infer_image_url = client.upload_file(input_image_path)
|
task = V2Task(api_path="/v2/task/grounding_dino/detection", api_body={
|
"model": "GroundingDino-1.6-Pro",
|
"image": infer_image_url,
|
"prompt": {
|
"type":"text",
|
"text":text_prompt
|
},
|
"targets": ["bbox"],
|
"bbox_threshold": 0.25,
|
"iou_threshold": 0.8
|
})
|
client.run_task(task)
|
print(task.result)
|
pbar_files.update(1)
|
pbar_subdirs.update(1)
|
Apache License
|
Version 2.0, January 2004
|
http://www.apache.org/licenses/
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
1. Definitions.
|
"License" shall mean the terms and conditions for use, reproduction,
|
and distribution as defined by Sections 1 through 9 of this document.
|
"Licensor" shall mean the copyright owner or entity authorized by
|
the copyright owner that is granting the License.
|
"Legal Entity" shall mean the union of the acting entity and all
|
other entities that control, are controlled by, or are under common
|
control with that entity. For the purposes of this definition,
|
"control" means (i) the power, direct or indirect, to cause the
|
direction or management of such entity, whether by contract or
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
"You" (or "Your") shall mean an individual or Legal Entity
|
exercising permissions granted by this License.
|
"Source" form shall mean the preferred form for making modifications,
|
including but not limited to software source code, documentation
|
source, and configuration files.
|
End of preview.
README.md exists but content is empty.
- Downloads last month
- 2