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
Download hug/lib/python3.12/site-packages/fontTools/ttLib/tables/BitmapGlyphMetrics.py from dl1wjd2/Logistics_AX: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/dl1wjd2/Logistics_AX/resolve/main/hug/lib/python3.12/site-packages/fontTools/ttLib/tables/BitmapGlyphMetrics.py
- Command line
-
hf download hf://dl1wjd2/Logistics_AX/hug/lib/python3.12/site-packages/fontTools/ttLib/tables/BitmapGlyphMetrics.py
-
curl -L -o BitmapGlyphMetrics.py https://huggingface.co/dl1wjd2/Logistics_AX/resolve/main/hug/lib/python3.12/site-packages/fontTools/ttLib/tables/BitmapGlyphMetrics.py
1.77 kB
| # Since bitmap glyph metrics are shared between EBLC and EBDT | |
| # this class gets its own python file. | |
| from fontTools.misc import sstruct | |
| from fontTools.misc.textTools import safeEval | |
| import logging | |
| log = logging.getLogger(__name__) | |
| bigGlyphMetricsFormat = """ | |
| > # big endian | |
| height: B | |
| width: B | |
| horiBearingX: b | |
| horiBearingY: b | |
| horiAdvance: B | |
| vertBearingX: b | |
| vertBearingY: b | |
| vertAdvance: B | |
| """ | |
| smallGlyphMetricsFormat = """ | |
| > # big endian | |
| height: B | |
| width: B | |
| BearingX: b | |
| BearingY: b | |
| Advance: B | |
| """ | |
| class BitmapGlyphMetrics(object): | |
| def toXML(self, writer, ttFont): | |
| writer.begintag(self.__class__.__name__) | |
| writer.newline() | |
| for metricName in sstruct.getformat(self.__class__.binaryFormat)[1]: | |
| writer.simpletag(metricName, value=getattr(self, metricName)) | |
| writer.newline() | |
| writer.endtag(self.__class__.__name__) | |
| writer.newline() | |
| def fromXML(self, name, attrs, content, ttFont): | |
| metricNames = set(sstruct.getformat(self.__class__.binaryFormat)[1]) | |
| for element in content: | |
| if not isinstance(element, tuple): | |
| continue | |
| name, attrs, content = element | |
| # Make sure this is a metric that is needed by GlyphMetrics. | |
| if name in metricNames: | |
| vars(self)[name] = safeEval(attrs["value"]) | |
| else: | |
| log.warning( | |
| "unknown name '%s' being ignored in %s.", | |
| name, | |
| self.__class__.__name__, | |
| ) | |
| class BigGlyphMetrics(BitmapGlyphMetrics): | |
| binaryFormat = bigGlyphMetricsFormat | |
| class SmallGlyphMetrics(BitmapGlyphMetrics): | |
| binaryFormat = smallGlyphMetricsFormat | |