-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs: refactor data types pages (#921)
- Loading branch information
1 parent
0ed0d13
commit c889406
Showing
14 changed files
with
148 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ArrowRow | ||
|
||
::: datachain.lib.file.ArrowRow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Bounding Box | ||
|
||
::: datachain.model.bbox.BBox | ||
|
||
::: datachain.model.bbox.OBBox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# File | ||
|
||
`File` is a special [`DataModel`](index.md#datachain.lib.data_model.DataModel), | ||
which is automatically generated when a `DataChain` is created from files, | ||
such as in [`DataChain.from_storage`](../datachain.md#datachain.lib.dc.DataChain.from_storage): | ||
|
||
```python | ||
from datachain import DataChain | ||
|
||
dc = DataChain.from_storage("gs://datachain-demo/dogs-and-cats") | ||
dc.print_schema() | ||
``` | ||
|
||
Output: | ||
|
||
``` | ||
file: File@v1 | ||
source: str | ||
path: str | ||
size: int | ||
version: str | ||
etag: str | ||
is_latest: bool | ||
last_modified: datetime | ||
location: Union[dict, list[dict], NoneType] | ||
``` | ||
|
||
`File` classes include various metadata fields describing the underlying file, | ||
along with methods to read and manipulate file contents. | ||
|
||
::: datachain.lib.file.File | ||
|
||
::: datachain.lib.file.FileError | ||
|
||
::: datachain.lib.file.TarVFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ImageFile | ||
|
||
`ImageFile` is inherited from [`File`](file.md) with additional methods for working with image files. | ||
|
||
`ImageFile` is generated when a `DataChain` is created [from storage](../datachain.md#datachain.lib.dc.DataChain.from_storage), using `type="image"` param: | ||
|
||
```python | ||
from datachain import DataChain | ||
|
||
dc = DataChain.from_storage("s3://bucket-name/", type="image") | ||
``` | ||
|
||
::: datachain.lib.file.ImageFile | ||
|
||
::: datachain.lib.file.Image |
2 changes: 1 addition & 1 deletion
2
docs/references/datatype.md → docs/references/data-types/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Pose | ||
|
||
::: datachain.model.pose.Pose | ||
|
||
::: datachain.model.pose.Pose3D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Segment | ||
|
||
::: datachain.model.segment.Segment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# TarVFile | ||
|
||
::: datachain.lib.file.TarVFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# TextFile | ||
|
||
`TextFile` is inherited from [`File`](file.md) with additional methods for working with text files. | ||
|
||
`TextFile` is generated when a `DataChain` is created [from storage](../datachain.md#datachain.lib.dc.DataChain.from_storage), using `type="text"` param: | ||
|
||
```python | ||
from datachain import DataChain | ||
|
||
dc = DataChain.from_storage("s3://bucket-name/", type="text") | ||
``` | ||
|
||
::: datachain.lib.file.TextFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# VideoFile | ||
|
||
`VideoFile` extends [`File`](file.md) and provides additional methods for working with video files. | ||
|
||
`VideoFile` instances are created when a `DataChain` is initialized [from storage](../datachain.md#datachain.lib.dc.DataChain.from_storage) with the `type="video"` parameter: | ||
|
||
```python | ||
from datachain import DataChain | ||
|
||
dc = DataChain.from_storage("s3://bucket-name/", type="video") | ||
``` | ||
|
||
There are additional models for working with video files: | ||
|
||
- `VideoFrame` - represents a single frame of a video file. | ||
- `VideoFragment` - represents a fragment of a video file. | ||
|
||
These are virtual models that do not create physical files. | ||
Instead, they are used to represent the data in the `VideoFile` these models are referring to. | ||
If you need to save the data, you can use the `save` method of these models, | ||
allowing you to save data locally or upload it to a storage service. | ||
|
||
::: datachain.lib.file.VideoFile | ||
|
||
::: datachain.lib.file.VideoFrame | ||
|
||
::: datachain.lib.file.VideoFragment | ||
|
||
::: datachain.lib.file.Video |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters