Comments (3)
You were right! it was because there were no fonts available in the container.
So i tried your solution by adding default font to my project and load it like this:
using var ploted = await result.PlotImageAsync(image, new() { FontFamily = new FontCollection().Add(fontPath) });
However, upon initialization, the PlottingOptions
constructor will always invokes GetDefaultFontFamily()
, which is the main problem since there are no system fonts in the first place.
public PlottingOptions()
{
FontFamily = GetDefaultFontFamily();
FontSize = 12f;
}
So currently my solution is by installing ttf-mscorefonts-installer for default SystemFonts
on my Docker container. However, this solution is suboptimal as it could potentially degrade server performance.
RUN echo "deb http://deb.debian.org/debian/ bookworm main contrib" > /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian/ bookworm main contrib" >> /etc/apt/sources.list && \
echo "deb http://security.debian.org/ bookworm-security main contrib" >> /etc/apt/sources.list && \
echo "deb-src http://security.debian.org/ bookworm-security main contrib" >> /etc/apt/sources.list
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig
Well I think by using FirstOrDefault()
in GetDefaultFontFamily()
is better than First()
since it wont throw Sequence contains no elements and FontFamily can be reassigned if there are no fonts available.
from yolov8.
I'll fix it soon, thanks for reporting it.
from yolov8.
from yolov8.
Related Issues (20)
- [discussion] optimize code logic to improve operational efficiency HOT 2
- Index was outside the bounds of the array. HOT 5
- Logic for resizing images to fit the size of the model input data. HOT 4
- Inference with Camera HOT 2
- It's not really using the GPU
- Getting lower confidence values HOT 2
- Load Image HOT 2
- Possible to select between fp16 and fp32? HOT 1
- some pictures does not show transparent boxes HOT 1
- DetectObb is not showing any bounding boxes for object (car in my case) HOT 6
- Processing video files HOT 1
- can't set configuration for create a predictor HOT 4
- Model trained with rect=True HOT 4
- ProcessMask may throw Exception when box`s height is 0 HOT 4
- The given key 'author' was not present in the dictionary HOT 2
- How to change the 'line_width' parameter when I get a plotted image? HOT 1
- How to crop & save detection HOT 1
- The current .NET SDK does not support 'newer version' as a target.
- how to draw obb detection boxes, HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov8.