Dataset Preview
Duplicate
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:    TypeError
Message:      int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1531, in _prepare_split_single
                  for key, record in generator:
                                     ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 127, in _generate_examples
                  for example_idx, example in enumerate(self._get_pipeline_from_tar(tar_path, tar_iterator)):
                                              ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 32, in _get_pipeline_from_tar
                  for filename, f in tar_iterator:
                                     ^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/utils/track.py", line 49, in __iter__
                  for x in self.generator(*self.args):
                           ~~~~~~~~~~~~~~^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/utils/file_utils.py", line 1405, in _iter_from_urlpath
                  with xopen(urlpath, "rb", download_config=download_config, block_size=0) as f:
                       ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/utils/file_utils.py", line 982, in xopen
                  file_obj = fs.open(paths[0], mode)
                File "<string>", line 3, in open
                File "/usr/local/lib/python3.14/unittest/mock.py", line 1176, in __call__
                  return self._mock_call(*args, **kwargs)
                         ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/unittest/mock.py", line 1180, in _mock_call
                  return self._execute_mock_call(*args, **kwargs)
                         ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/unittest/mock.py", line 1247, in _execute_mock_call
                  result = effect(*args, **kwargs)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 786, in wrapped
                  tracker.files[urlpath] = {"read": 0, "size": int(f.size)}
                                                               ~~~^^^^^^^^
              TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
              
              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 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1393, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1571, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

mat
unknown
__key__
string
__url__
string
"TUFUTEFCIDUuMCBNQVQtZmlsZSwgUGxhdGZvcm06IFBDV0lONjQsIENyZWF0ZWQgb246IFR1ZSBKYW4gMDUgMDQ6MDI6MzYgMjA(...TRUNCATED)
zebrafish-raw-sample/data10282015_08_33_AMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
"TUFUTEFCIDUuMCBNQVQtZmlsZSwgUGxhdGZvcm06IFBDV0lONjQsIENyZWF0ZWQgb246IFdlZCBEZWMgMDIgMjM6MTA6NTkgMjA(...TRUNCATED)
zebrafish-raw-sample/data10282015_10_43_AMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/dataset
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data09092015_10_26_AMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data09092015_11_10_AMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data10132015_01_42_PMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data10132015_02_35_PMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data10232015_02_29_PMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data10262015_03_16_PMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
null
zebrafish-wt-tracks/tracks/convert-zfish_trx_mat.0.2-072e1e1a71/data10262015_10_00_AMAB
"hf://datasets/EcodylicScience/mosaic-example-zebrafish@3ff7f840a32a1e749694f90e12990ae41fdf93ad/zeb(...TRUNCATED)
End of preview.

Zebrafish wild type, collective motion and social forces

Pose tracks for 33 trials of wild-type (AB strain) zebrafish, six per group, free-swimming in a circular arena about 48 cm across, filmed from above at 60 Hz for 30 minutes. Converted to mosaic parquet tables and ready to analyse without a conversion step.

Worked example: notebooks/collective-motion-zebrafish.ipynb. Set SOURCE = "download" (the default) and it fetches both files below.

A tracker with no keypoints

This is a Ctrax/JAABA-style trx tracker: it reports a centroid, an orientation and a fitted ellipse, and locates no keypoints at all. So these tables carry X, Y and ANGLE and no poseX* / poseY* columns — which makes the dataset a useful case for anyone whose own tracker does the same. Features that genuinely need keypoints refuse a table without them, naming themselves; features that merely prefer them fall back to the body centre.

X / Y is the tracker's centroid, as mosaic_v1 asks. (Contrast the shiners dataset, where it is the head.)

Files

File Size What it is
zebrafish-wt-tracks.tar.gz 767 MB A complete mosaic dataset: dataset.yaml + tracks/. 33 trials, about 21.4 million rows.
zebrafish-raw-sample.tar.gz 79 MB Two trials of raw .mat, copied verbatim.

SHA256SUMS carries the checksums.

The raw sample exists so the example notebook can run its converter rather than only display it. Converting the two samples reproduces the shipped tables exactly, and the notebook asserts this before going on.

Contents

Columns: frame, time, id, group, sequence, X, Y, ANGLE, body_length, body_width, px_per_cm. Positions are video pixels; px_per_cm is 40.236 and is carried per row so the calibration travels with the data, but the columns are not scaled by it — a physical unit is obtained downstream by mosaic's scale-to-cm feature, never stored in the table.

ANGLE is the ellipse fit's head-resolved orientation, which the tracker measures directly — hence the zfish_trx_v1 schema (mosaic_v1 plus ANGLE) rather than plain mosaic_v1.

group is empty for every row: these trials form one flat set with no grouping level. That is legal — group is an optional namespace, and sequence alone identifies each trial.

Use

import tarfile
from huggingface_hub import hf_hub_download
from mosaic.core.dataset import Dataset

path = hf_hub_download("EcodylicScience/mosaic-example-zebrafish",
                       "zebrafish-wt-tracks.tar.gz", repo_type="dataset")
with tarfile.open(path) as tar:
    tar.extractall("data")

ds = Dataset("data/zebrafish-wt-tracks/dataset.yaml").load()
tracks = ds.load_tracks("", "data10282015_10_43_AMAB")

huggingface_hub >= 1.2.0 is worth pinning: older clients retry a rate-limit response with a 25-second backoff against a 5-minute window, so they fail where a current client waits.

Provenance and changes

Derived from the Dryad record accompanying Tang et al. (2020). CC0 1.0, so this derivative carries the same terms.

Source: doi:10.5061/dryad.hx3ffbg9n

What was changed:

  • The trx MATLAB struct arrays were converted to mosaic zfish_trx_v1 parquet tables. Column names and layout differ from the original release. Positions and orientations are unaltered — x, y and theta are carried through verbatim.
  • A failed ellipse fit is reported as an exact zero in the source, and is converted to NaN here. This affects 12% to 46% of rows depending on the trial, 21% overall. Read literally, a zero is a fish zero pixels long: it drags the median body length down and would collapse any derived pose onto the centroid. This is the one place a value is changed rather than carried across, and it is the reason to prefer these tables over a naive read of the source.
  • Fields not converted: arena (stale fly-bowl template data — it reports a radius of 254 px while the fish occupy 108–1983 px), and the movie-name and bookkeeping fields.

Not included: video. Only pose data is distributed in the source record.

Citation

Tang W, Davidson JD, Zhang G, Conen KE, Fang J, Serluca F, Li J, Xiong X, Coble M, Tsai T, Molind G, Fawcett CH, Sanchez E, Zhu P, Couzin ID, Fishman MC (2020) Genetic Control of Collective Behavior in Zebrafish. iScience 23(3): 100942. doi:10.1016/j.isci.2020.100942

Downloads last month
43