This topic describes TensorBay dataset operations:
examples/move_and_copy:Copy Segment
examples/move_and_copy:Move Segment
examples/move_and_copy:Copy Data
examples/move_and_copy:Move Data
Take the Oxford-IIIT Pet as an example. Its structure looks like:
datasets/
test/
Abyssinian_002.jpg
...
trainval/
Abyssinian_001.jpg
...
Note
Before operating this dataset, fork it first.
Get the dataset client.
../../../docs/code/move_and_copy.py
There are currently two segments: test
and trainval
.
Copy segment test
to test_1
.
../../../docs/code/move_and_copy.py
Move segment test
to test_2
.
../../../docs/code/move_and_copy.py
Copy all data with prefix Abyssinian
in both test_1
and trainval
segments to abyssinian
segment.
../../../docs/code/move_and_copy.py
Split trainval
segment into train
and val
:
- Extract 500 data from
trainval
toval
segment. - Move
trainval
totrain
.
../../../docs/code/move_and_copy.py
Note
The data storage space will only be calculated once when a segment is copied.
Note
TensorBay SDK supports three strategies to solve the conflict when the target segment/data already exists, which can be set as an keyword argument in the above-mentioned functions.
- abort(default): abort the process by raising ResponseSystemError.
- skip: skip moving or copying segment/data.
- override: override the whole target segment/data with the source segment/data.