announcement
This commit is contained in:
commit
11bce7d105
1 changed files with 118 additions and 0 deletions
118
README.md
Normal file
118
README.md
Normal file
|
@ -0,0 +1,118 @@
|
|||
# Stich-a-Thon Contest Guidelines
|
||||
|
||||
Welcome, everyone! Get ready for a challenge designed to test your coding prowess, creativity, and performance optimization skills. This contest is all about having fun, and finding out who can create the most efficient solution to a unique problem.
|
||||
|
||||
## 1. Quick Info
|
||||
|
||||
| Category | Details |
|
||||
| -------------------- | -------------------------------------------------------------------------- |
|
||||
| **Contest Format** | Compete individually or in a team of two. |
|
||||
| **Timeline** | **2-4 weeks**, starting now! |
|
||||
| **Technology** | **ASP.NET for REST API is mandatory.** Other libraries/tools are your choice. |
|
||||
| **Prize** | The ultimate prize: Honor, glory, and eternal bragging rights! |
|
||||
| **Submission** | Link to a Git repository under [contest git server](https://null.formulatrix.dev) |
|
||||
| **Questions?** | Ask anytime in the **`Async Loop`** group chat. |
|
||||
|
||||
## 2. The Challenge: The Image Stitcher API
|
||||
|
||||
Your mission is to build a high-performance web API that can dynamically stitch together tiled images, crop a specific region from the result, and serve a final, scaled image.
|
||||
|
||||
### Objective
|
||||
Create an ASP.NET REST API endpoint that receives a JSON payload specifying a region of a conceptual grid, crops it, and resizes it.
|
||||
|
||||
### Provided Assets
|
||||
You will be provided with a set of **1705** images files named according to a standard SBS plate coordinate system: `A1.png`, `A2.png`, ..., up to `AE55.png`. These are your source tiles. You must treat them as a single cohesive grid (A-AE as rows, 1-55 as columns). The size of each image is `720x720` pixels.
|
||||
|
||||
[Click here to download the images](https://drive.google.com/file/d/17i-KDjMlRJhmOY8kBIzG2eA-L2mCoqfN/view?usp=sharing).
|
||||
|
||||
### API Specification
|
||||
|
||||
* **Endpoint:** `POST /api/image/generate`
|
||||
* **Request Body:** `application/json`
|
||||
* **Successful Response:** `200 OK` with the `Content-Type` of `image/png` and the image data in the body.
|
||||
|
||||
#### Request Body Structure:
|
||||
```json
|
||||
{
|
||||
"canvas_rect": "A1:H12",
|
||||
"crop_offset": [0.25, 0.25],
|
||||
"crop_size": [0.5, 0.5],
|
||||
"output_scale": 1.0
|
||||
}
|
||||
```
|
||||
|
||||
### Input Parameter Details
|
||||
|
||||
* `canvas_rect` (string)
|
||||
* Defines the bounding box of tiles to stitch together *before* cropping.
|
||||
* The format is `coordinate1:coordinate2`, e.g., `"C3:F6"`.
|
||||
* Your code must be able to figure out the bounding box based on the coordinate only ( e.g. `"A1:H12"` and `"H1:A12"` are the same bounding box )
|
||||
* `crop_offset` (array of floats)
|
||||
* A normalized `[x, y]` offset for the crop, relative to the top-left corner of the stitched `canvas_rect` image.
|
||||
* Values range from `0.0` to `1.0`. `[0, 0]` is the top-left of the stiched canvas.
|
||||
* `crop_size` (array of floats)
|
||||
* The normalized `[width, height]` of the crop, relative to the dimensions of the stitched `canvas_rect` image.
|
||||
* Values range from `0.0` to `1.0`. `[1, 1]` would be the full stitched image.
|
||||
* `output_scale` (float)
|
||||
* A scaling factor applied to the cropped image before it's returned. `1.0` means original size, `0.5` is 50% smaller.
|
||||
* Values range from `0 > scale >= 1.0`
|
||||
### Canvas Visual Guide
|
||||
```
|
||||
Origin (0,0)
|
||||
┌─────────────────┬───────────────────────────────────────┐
|
||||
│ │ │
|
||||
x+ │ │offset.y │
|
||||
┌────► │ │ │
|
||||
│ │ │ │
|
||||
y+ │ ├────────────────►▼ ┌──────────────────┐ ▲ │
|
||||
▼ │ offset.x │ │ │ │
|
||||
│ │ │ │ │
|
||||
│ │ FINAL IMAGE │ │ size.y │
|
||||
│ │ │ │ │
|
||||
│ │ │ │ │
|
||||
│ └──────────────────┘ ▼ │
|
||||
│ ◄──────────────────► │
|
||||
│ size.x │
|
||||
│ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
You can safely assume all parameters passed to this API are valid.
|
||||
|
||||
## 3. Evaluation Criteria
|
||||
|
||||
Evaluation is a two-step process. Submissions must pass Step 1 to be considered for Step 2.
|
||||
|
||||
### Step 1: Correctness (Pass/Fail)
|
||||
The output image from your API will be visually inspected. If the stitched, cropped, and scaled image is not what is expected from the input parameters, the submission is considered incorrect and will not be benchmarked for performance. **An incorrect submission receives no score.**
|
||||
|
||||
### Step 2: Performance Benchmarking
|
||||
If the output is correct, your API will be benchmarked on two key metrics:
|
||||
1. **Latency:** The average time taken to respond to a request across several test cases.
|
||||
2. **Throughput:** The number of requests your API can handle per second under a sustained load. (author: I need to think about to do this in a consistent way)
|
||||
|
||||
|
||||
### The benchmark machine
|
||||
- Raspberry Pi CM5 w/ Debian Bookworm 64-bit
|
||||
|
||||
### The Scoreboard
|
||||
There is no single numerical score. The final results will be presented as a **comparative chart** showcasing the latency and throughput of all qualifying participants. This will allow us to visualize who built the fastest and most robust solutions.
|
||||
|
||||
## 4. Submission Guidelines
|
||||
|
||||
* **What to Submit:** A link to your private Git repository on our internal Git server. Please ensure the final, runnable version is on the `main` or `master` branch, and please put a semver tag. Set your repository to private and invite me to it.
|
||||
* **Technology Stack:** The REST API **must** be built using **ASP.NET**. You are free to use any open-source libraries (e.g., for image processing) as you see fit.
|
||||
* **A Note on Setup Simplicity:** Your repository **must** contain a clear `README.md` file with simple, step-by-step instructions on how to build and run your project. **The easier you make it for me to run your code, the better.** I will not spend significant time debugging complex or undocumented setups.
|
||||
|
||||
## 5. Rules & Fair Play
|
||||
|
||||
I know it's for fun but it's a good thing to have rules.
|
||||
|
||||
1. **Team Formation:** You may work alone or in a team of a maximum of two members.
|
||||
2. **Use of Libraries:** You are free and encouraged to use any open-source libraries. No closed source or commercial solution allowed.
|
||||
3. **No-pre processing** can be performed before receiving the first API request.
|
||||
4. **Collaboration:** Collaboration or code sharing between different teams/individuals is forbidden. Otherwise it won't be fun.
|
||||
5. **Organizer's Discretion:** The contest organizer reserves the right to make final judgments on all matters, including disqualifying any entry that violates the spirit of fair and respectful competition
|
||||
|
||||
Good luck, have fun, and let the coding begin
|
Loading…
Add table
Add a link
Reference in a new issue