readme update

This commit is contained in:
reinard.setiadji@formulatrix.com 2025-08-01 16:09:36 +07:00
parent c73793ed1b
commit 7f0b498c01

View file

@ -1,4 +1,4 @@
# I Paid for 4 Gigabytes of RAM So I Will Use All 4 Gigabytes of RAM and Probably More
# I Paid for 4 GB of RAM So I Will Use The Whole 4 GB of RAM (and Probably More)
Submission for Stitch-A-Ton Contest.
## Prerequisites
@ -14,10 +14,18 @@ Submission for Stitch-A-Ton Contest.
If the test cases does not request a large portion of the canvas ***AND*** resizes it to a relatively still large ratio (i,e, ~0.9) **at the same time**, this might not be necessary.
- **Access to** the `mkfifo` command, satisfied by default bar very special cases
- **OpenCVSharp4 Runtime for Raspberry Pi 5**
A copy exists in this repository's release page.
If running via dotnet run, Download the `.nupkg` file [here](https://null.formulatrix.dev/reinardras/stitch_something/releases/tag/0.0.0) and save on `LocalNuget` before running. Otherwise it shouldn't be necessary.
If there's still a problem with library being missing, download the `.so` file and put it on `/usr/local/lib`.
## Running
Either of these method works.
### Via dotnet run
On root directory:
```
ASSET_PATH_RO=<path> dotnet run --project StitchATon --profile deploy
@ -31,6 +39,17 @@ The API is accessible at `:5255`, providing the following api:
To browse the API, prepend `ASPNETCORE_ENVIRONMENT=Development` to the command and go to `/swagger/index.html`.
### Via releases
Download [here](https://null.formulatrix.dev/reinardras/stitch_something/releases/).
Run with the same parameters:
```
ASSET_PATH_RO=<path> ./StitchATon --profile deploy
```
## Writeup
This submission contains no specific magic in the image processing, just OpenCVSharp stretched to the best of its ability according to my knowledge. This section contains a brief overview of the main features.
@ -72,7 +91,7 @@ The status "Currently being loaded" is relevant when multiple requests requiring
**This mechanism enables the shared canvas to serve multiple processes.**
### Serving and Encoding cropped image
### Encoding and Serving Cropped Image
After the needed chunks are certain to be loaded to the main canvas, next is cropping it; which is a trivial operation in OpenCV, not requiring any extra memory since it still refers to the main canvas.
What's not trivial is *encoding* it, which after some quick tests shows to take longer than reading and decoding multiple images from the canvas.