Build and upload to PyPI
To build the package:
pip install build
python -m build
To upload the package:
pip install twine
python -m twine upload --repository pypi dist/*
General use
Everything you need is stored in the ffysh import or in the ffysh CLI - you don't need to worry about its submodules.
Create a project and log in to Flockfysh
- Ensure your current working directory is correct.
- From the terminal, run these two commands:
ffysh init ffysh login
- Log in to Flockfysh using the new browser window and click
Approveto allow ffysh to use your account.
Datasets
-
You'll first need to create a Dataset object first, using the 24-character ID of the dataset you want. If the dataset does not exist, an error will be thrown.
from ffysh import Dataset dataset = Dataset("some_dataset_id")
-
From there, you can create a stream object.
stream = dataset.create_stream()
Additional dataset attributes and methods:
# Print dataset ID.
print(dataset.dataset_id)
Streams
Streams are the basic unit of operation in ffysh. Each stream is a lazy-loaded snapshot of a dataset, and it expands as much as the user needs. Alternatively, you can use it as if it is a Python list.
-
First, store the ID of the stream for later use.
with open("stream_id.json", "w") as file: json.dump({"id": stream.stream_id}, file)
-
This allows the stream to reload from disk.
from ffysh import Stream with open("stream_id.json", "w") as file: stream = Stream.load(json.load(file)["id"]
Note that each stream instance can only be created or loaded once, and if it is load twice, the old stream instance will be returned.
with open("stream_id.json", "w") as file: stream2 = Stream.load(json.load(file)["id"] print(stream is stream2) # True
-
Stream methods:
from ffysh import Stream with open("stream_id.json", "w") as file: stream = Stream.load(json.load(file)["id"] # Iteration for asset in stream: print(asset) # Stream indexing and slicing print(stream[0:5:2]) # Loads the next 5 items that has not been loaded yet # into the cache, and return them. If the stream ends, # an empty list is returned, and any more calls will raise # a StopIteration exception. stream.next_assets(5) # Expands the stream until the stream ends or is at least 100 # items long by loading more items from the cache. stream.expand(100) # Expands the stream until the end. stream.expand() # Convert the entire stream to a PyTorch zip. stream.to_pytorch("./dataset.zip", confidence_level=0.6)
Limitations
- You must not use a stream in 2 Python programs at a time. If you want to, create a second stream or quit the first program. Although you still have to re-download labels, images will be cached in a separate directory, so that multiple streams can access the same asset.
- Even if assets and their labels are deleted remotely, they will stay intact locally. We'll introduce a way to discard unused streams and purge redundant images in the future.
Metadata
Release files for fysh 0.0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fysh-0.0.1.9.tar.gz | 17.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fysh-0.0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.1 kB
Release files / fysh-0.0.1.9.tar.gz
| Download URL | fysh-0.0.1.9.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68308ce8864680641e5ebc524ca062a7f3d2f6fac813b43ffd9ae9fa1490f20d
|
|
BLAKE2b-256 checksum How to use checksums |
6fd2c5d135e92a5a38e6aa8cb7722c97e175c03ff90df80f42e8083d64383306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-1041-azure
|
Release files / fysh-0.0.1.9-py3-none-any.whl
| Download URL | fysh-0.0.1.9-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a79f0e286fa4b2c616f8ed11bac01a1c3c8740bbe01007c273e339ffae8d5f14
|
|
BLAKE2b-256 checksum How to use checksums |
79f01a7a95fc51baa798de0749435f6933b0b10e4b89de63c22fb2c85394d1d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-1041-azure
|