Instructions to use dl1wjd2/Logistics_AX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use dl1wjd2/Logistics_AX with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("dl1wjd2/Logistics_AX", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
File size: 972 Bytes
bbae060 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | from __future__ import annotations
import typing
from pathlib import PurePosixPath
from ._errors import DirectoryNotEmpty
if typing.TYPE_CHECKING:
from typing import IO
from ._base import FS
def remove_empty(fs: FS, path: str):
"""Remove all empty parents."""
path = PurePosixPath(path)
root = PurePosixPath("/")
try:
while path != root:
fs.removedir(path.as_posix())
path = path.parent
except DirectoryNotEmpty:
pass
def copy_file_data(src_file: IO, dst_file: IO, chunk_size: int | None = None):
"""Copy data from one file object to another."""
_chunk_size = 1024 * 1024 if chunk_size is None else chunk_size
read = src_file.read
write = dst_file.write
# in iter(callable, sentilel), callable is called until it returns the sentinel;
# this allows to copy `chunk_size` bytes at a time.
for chunk in iter(lambda: read(_chunk_size) or None, None):
write(chunk)
|