You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/object_detection.mdx
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,34 @@ description: Learn about how to detect objects in your images and use them with
5
5
6
6
# Object detection ((pro))
7
7
8
-
imgproxy can detect objects in the image and use them for smart cropping, blurring the detections, drawing the detections, or cropping to detected objects. You can also [fetch the detected objects info](../usage/getting_info.mdx#detect-objects).
8
+
imgproxy can detect objects in the image and use them for smart cropping, blurring the detections, or drawing the detections. You can also [fetch the detected objects info](../usage/getting_info.mdx#detect-objects).
9
9
10
-
For object purposes, imgproxy uses the YOLO (You Only Look Once) model family. imgproxy supports models in ONNX format. We provide Docker images with a model trained for face detection, but you can use any YOLO model found on the internet or train your own model.
10
+
For object purposes, imgproxy uses the YOLO (You Only Look Once) model family. imgproxy supports models in DarkNet or ONNX format. We provide Docker images with a model trained for face detection, but you can use any YOLO model found on the internet or train your own model.
11
11
12
12
## Configuration
13
13
14
14
:::tip
15
15
You don't need to configure object detection if you're using an imgproxy Pro Docker image with a tag suffixed with `-ml` and you want to use the face detection model. The model is already included in the image and the configuration is already set up.
16
16
:::
17
17
18
+
:::info
19
+
DarkNet model format has priority over ONNX model format. If you define both, imgproxy will use the DarkNet model.
20
+
:::
21
+
22
+
### DarkNet model format
23
+
24
+
:::warning
25
+
DarkNet models support is deprecated and will be removed in imgproxy v4. Please use ONNX models instead.
26
+
:::
27
+
28
+
You need to define the following config variables to enable object detection with a [DarkNet](https://github.com/AlexeyAB/darknet) model:
29
+
30
+
*[`IMGPROXY_OBJECT_DETECTION_CONFIG`]: a path to the neural network config in DarkNet format
31
+
*[`IMGPROXY_OBJECT_DETECTION_WEIGHTS`]: a path to the neural network weights in DarkNet format
32
+
*[`IMGPROXY_OBJECT_DETECTION_CLASSES`]: a path to the [class names file](#class-names-file)
33
+
34
+
### ONNX model format
35
+
18
36
You need to define the following config variables to enable object detection with an ONNX model:
19
37
20
38
*[`IMGPROXY_OBJECT_DETECTION_NET`]: a path to the neural network model in ONNX format
@@ -318,20 +336,6 @@ You can make imgproxy [draw bounding boxes](../usage/processing.mdx#draw-detecti
318
336
.../draw_detections:1:face/...
319
337
```
320
338
321
-
### Crop to detected objects
322
-
323
-
You can make imgproxy [crop the image](../usage/processing.mdx#crop-objects) to fit all detected objects of the desired classes:
324
-
325
-
```imgproxy_url
326
-
.../crop_objects:1.2:face:person/...
327
-
```
328
-
329
-
This will automatically crop the image to include all detected faces and persons with 20% padding around them. You can omit class names to crop to all detected objects:
330
-
331
-
```imgproxy_url
332
-
.../co:1.0/...
333
-
```
334
-
335
339
### Fetch the detected objects' info
336
340
337
341
You can [fetch the detected objects info](../usage/getting_info.mdx#detect-objects) using the `/info` endpoint:
| Other video formats ((pro)) ||[See notes](#video-thumbnails)|:x:|
27
26
@@ -37,6 +36,10 @@ imgproxy supports SVG sources without limitations, but SVG results are not suppo
37
36
38
37
When the source image is SVG and an SVG result is requested, imgproxy returns the source image without modifications.
39
38
39
+
imgproxy reads some amount of bytes to check if the source image is SVG. By default it reads a maximum of 32KB, but you can change this:
40
+
41
+
*`IMGPROXY_MAX_SVG_CHECK_BYTES`: the maximum number of bytes imgproxy will read to recognize SVG. If imgproxy can't recognize your SVG, try to increase this number. Default: `32768` (32KB)
42
+
40
43
## Animated images support
41
44
42
45
Since the processing of animated images is a pretty heavy process, only one frame is processed by default. You can increase the maximum of animation frames to process with the following variable:
@@ -67,12 +70,6 @@ We tested imgproxy with all variants of PSD/PSB files that we could find or prod
67
70
We couldn't find any PSD/PSB files with their image data compressed with ZIP, so imgproxy renders them as solid white images. If you had such files, we would very much appreciate it if you could share them with us.
68
71
:::
69
72
70
-
## RAW support ((pro)) {#raw-support}
71
-
72
-
RAW image formats from digital cameras are supported as source images only (read-only). RAW files are decoded and converted to standard image formats during processing.
73
-
74
-
imgproxy uses [libraw](https://www.libraw.org/) to process RAW files. For a complete list of supported camera models and RAW formats, see the [libraw supported cameras list](https://www.libraw.org/supported-cameras).
75
-
76
73
## Converting animated images to MP4 ((pro)) {#converting-animated-images-to-mp4}
77
74
78
75
Animated image results can be converted to MP4 by specifying the `mp4` extension.
@@ -87,22 +84,3 @@ Since this still requires more data to be downloaded, video thumbnail generation
87
84
88
85
*`IMGPROXY_ENABLE_VIDEO_THUMBNAILS`: when true, enables video thumbnail generation. Default: `false`
89
86
*`IMGPROXY_VIDEO_THUMBNAIL_SECOND`: the timestamp of the frame (in seconds) that will be used for the thumbnail. Default: `1`.
90
-
91
-
## Colorspace and HDR preservation
92
-
93
-
imgproxy always preserves the source image's colorspace:
94
-
95
-
* Color images remain color images.
96
-
* Grayscale images remain grayscale images.
97
-
* Colorspace types are maintained.
98
-
99
-
The bit depth handling depends on the [IMGPROXY_PRESERVE_HDR](configuration/options.mdx#IMGPROXY_PRESERVE_HDR) configuration setting:
100
-
101
-
**When `IMGPROXY_PRESERVE_HDR` is enabled:**
102
-
103
-
* High bit images remain high bit in the output (eg, GRAYSCALE16 remains GRAYSCALE16, RGB16 stays RGB16, scRGB becomes RGB16)
104
-
105
-
**When `IMGPROXY_PRESERVE_HDR` is disabled (default):**
106
-
107
-
* High bit images are converted to 8-bit (eg, GRAYSCALE16 becomes GRAYSCALE8, RGB, RGB16 and scRGB become sRGB)
Copy file name to clipboardExpand all lines: docs/image_sources/amazon_s3.mdx
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ imgproxy can process images from S3 buckets. To use this feature, do the followi
11
11
3._(optional)_ Specify the [AWS region](#choosing-the-aws-region) with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
12
12
4._(optional)_ Specify the S3 endpoint with `IMGPROXY_S3_ENDPOINT`. You can also set `IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE=false` to use the virtual host style for the endpoint.
13
13
5._(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
14
-
6. Use `s3://%bucket_name/%file_key` as the source image URL.
14
+
6._(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
15
+
7._(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
16
+
8. Use `s3://%bucket_name/%file_key` as the source image URL.
15
17
16
18
If you need to specify the version of the source object, you can use the query string of the source URL:
17
19
@@ -76,17 +78,6 @@ This allows imgproxy to access buckets in any region. However, the initial reque
76
78
* If your most frequently used buckets are in the same region, set the region to that one.
77
79
* If your buckets are spread across multiple regions, set the region to the closest one to your imgproxy instance.
78
80
79
-
## Restricting bucket access
80
-
81
-
Restrict which S3 buckets imgproxy can access for security:
82
-
83
-
*`IMGPROXY_S3_ALLOWED_BUCKETS`: a comma-separated list of bucket names that imgproxy is allowed to access. When set, imgproxy will only process images from these buckets. Default: blank (all buckets allowed)
84
-
*`IMGPROXY_S3_DENIED_BUCKETS`: a comma-separated list of bucket names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these buckets. Default: blank
85
-
86
-
:::tip
87
-
Use `IMGPROXY_S3_ALLOWED_BUCKETS` to allow trusted buckets. Use `IMGPROXY_S3_DENIED_BUCKETS` to block specific ones. If both are set, allowed buckets override denied ones.
88
-
:::
89
-
90
81
## MinIO
91
82
92
83
[MinIO](https://github.com/minio/minio) is an object storage server released under Apache License v2.0. It is compatible with Amazon S3, so it can be used with imgproxy.
Copy file name to clipboardExpand all lines: docs/image_sources/azure_blob_storage.mdx
-11Lines changed: 0 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,14 +50,3 @@ For certificate authentication:
50
50
### Using Storage Account Key
51
51
52
52
Alternatively, you can set `IMGPROXY_ABS_KEY` to your Azure Blob Storage account key. See the [Manage storage account access keys](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage) guide for more info.
53
-
54
-
## Restricting container access
55
-
56
-
Restrict which Azure Blob Storage containers imgproxy can access for security:
57
-
58
-
*`IMGPROXY_ABS_ALLOWED_BUCKETS`: a comma-separated list of container names that imgproxy is allowed to access. When set, imgproxy will only process images from these containers. Default: blank (all containers allowed)
59
-
*`IMGPROXY_ABS_DENIED_BUCKETS`: a comma-separated list of container names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these containers. Default: blank
60
-
61
-
:::tip
62
-
Use `IMGPROXY_ABS_ALLOWED_BUCKETS` to allow trusted containers. Use `IMGPROXY_ABS_DENIED_BUCKETS` to block specific ones. If both are set, allowed containers override denied ones.
Copy file name to clipboardExpand all lines: docs/image_sources/google_cloud_storage.mdx
-11Lines changed: 0 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,14 +36,3 @@ Otherwise, set `IMGPROXY_GCS_KEY` environment variable to the content of Google
36
36
:::warning
37
37
For security reasons, imgproxy accepts only service account keys for Google Cloud Storage integration.
38
38
:::
39
-
40
-
## Restricting bucket access
41
-
42
-
Restrict which GCS buckets imgproxy can access for security:
43
-
44
-
*`IMGPROXY_GCS_ALLOWED_BUCKETS`: a comma-separated list of bucket names that imgproxy is allowed to access. When set, imgproxy will only process images from these buckets. Default: blank (all buckets allowed)
45
-
*`IMGPROXY_GCS_DENIED_BUCKETS`: a comma-separated list of bucket names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these buckets. Default: blank
46
-
47
-
:::tip
48
-
Use `IMGPROXY_GCS_ALLOWED_BUCKETS` to allow trusted buckets. Use `IMGPROXY_GCS_DENIED_BUCKETS` to block specific ones. If both are set, allowed buckets override denied ones.
Copy file name to clipboardExpand all lines: docs/image_sources/openstack_swift.mdx
-11Lines changed: 0 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,3 @@ imgproxy can process images from OpenStack Object Storage, also known as Swift.
20
20
:::tip
21
21
If filenames in your OpenStack Object Storage may contain `?`, you may want to set [IMGPROXY_SOURCE_URL_QUERY_SEPARATOR](../configuration/options.mdx#IMGPROXY_SOURCE_URL_QUERY_SEPARATOR) to another string that is not used in filenames or set it to blank to disable query string extraction.
22
22
:::
23
-
24
-
## Restricting container access
25
-
26
-
Restrict which Swift containers imgproxy can access for security:
27
-
28
-
*`IMGPROXY_SWIFT_ALLOWED_BUCKETS`: a comma-separated list of container names that imgproxy is allowed to access. When set, imgproxy will only process images from these containers. Default: blank (all containers allowed)
29
-
*`IMGPROXY_SWIFT_DENIED_BUCKETS`: a comma-separated list of container names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these containers. Default: blank
30
-
31
-
:::tip
32
-
Use `IMGPROXY_SWIFT_ALLOWED_BUCKETS` to allow trusted containers. Use `IMGPROXY_SWIFT_DENIED_BUCKETS` to block specific ones. If both are set, allowed containers override denied ones.
4._(optional)_ Set the `IMGPROXY_DATADOG_ENABLE_ADDITIONAL_METRICS` environment variable to `true` to collect the [additional metrics](#additional-metrics).
26
-
5._(optional)_ Set the `IMGPROXY_DATADOG_PROPAGATE_EXTERNAL` environment variable to `true` to propagate Datadog tracing headers to external requests such as image downloads. Default: `false`.
Copy file name to clipboardExpand all lines: docs/monitoring/new_relic.mdx
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ imgproxy can send its metrics to New Relic. To use this feature, do the followin
10
10
2. Set the `IMGPROXY_NEW_RELIC_KEY` environment variable to the license key.
11
11
3._(optional)_ Set the `IMGPROXY_NEW_RELIC_APP_NAME` environment variable to be the desired application name.
12
12
4._(optional)_ Set the `IMGPROXY_NEW_RELIC_LABELS` environment variable to be the desired list of labels. Example: `label1=value1;label2=value2`.
13
-
5._(optional)_ Set the `IMGPROXY_NEW_RELIC_PROPAGATE_EXTERNAL` environment variable to `true` to propagate New Relic tracing headers to external requests such as image downloads. Default: `false`.
14
13
15
14
imgproxy will send the following info to New Relic:
16
15
@@ -21,15 +20,15 @@ imgproxy will send the following info to New Relic:
21
20
* Image processing time
22
21
* Errors that occurred while downloading and processing an image
23
22
24
-
Additionally, imgproxy sends the following metrics over [Metrics API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/introduction-metric-api/) as timescales (all metric names are prefixed with `Custom/imgproxy/`):
23
+
Additionally, imgproxy sends the following metrics over [Metrics API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/introduction-metric-api/):
25
24
26
-
*`workers`: the configured number of imgproxy workers
27
-
*`requests_in_progress`: the number of requests currently in progress
28
-
*`images_in_progress`: the number of images currently in progress
29
-
*`workers_utilization`: the percentage of imgproxy's workers utilization. Calculated as `requests_in_progress / workers * 100`
30
-
*`buffer/size`: a summary of the download buffers sizes (in bytes)
31
-
*`buffer/default_size`: calibrated default buffer size (in bytes)
32
-
*`buffer/max_size`: calibrated maximum buffer size (in bytes)
33
-
*`vips/memory`: libvips memory usage (in bytes)
34
-
*`vips/max_memory`: libvips maximum memory usage (in bytes)
35
-
*`vips/allocs`: the number of active vips allocations
25
+
*`imgproxy.workers`: the configured number of imgproxy workers
26
+
*`imgproxy.requests_in_progress`: the number of requests currently in progress
27
+
*`imgproxy.images_in_progress`: the number of images currently in progress
28
+
*`imgproxy.workers_utilization`: the percentage of imgproxy's workers utilization. Calculated as `imgproxy.requests_in_progress / imgproxy.workers * 100`
29
+
*`imgproxy.buffer.size`: a summary of the download buffers sizes (in bytes)
30
+
*`imgproxy.buffer.default_size`: calibrated default buffer size (in bytes)
31
+
*`imgproxy.buffer.max_size`: calibrated maximum buffer size (in bytes)
32
+
*`imgproxy.vips.memory`: libvips memory usage (in bytes)
33
+
*`imgproxy.vips.max_memory`: libvips maximum memory usage (in bytes)
34
+
*`imgproxy.vips.allocs`: the number of active vips allocations
0 commit comments