Skip to content

Commit 102d875

Browse files
committed
Update readme and add PixelFormats to globals
1 parent 7492376 commit 102d875

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ The FaceDetector module detects faces in images and can optionally provide facia
7979

8080
#### Constructor
8181
```python
82-
FaceDetector(width=320, height=240, pixel_format=DL_IMAGE_PIX_TYPE_RGB888, features=True)
82+
FaceDetector(width=320, height=240, pixel_format=espdl.RGB888, features=True)
8383
```
8484

8585
**Parameters:**
8686
- `width` (int, optional): Input image width. Default: 320
8787
- `height` (int, optional): Input image height. Default: 240
88-
- `pixel_format` (int, optional): Input image pixel format. Default: DL_IMAGE_PIX_TYPE_RGB888
88+
- `pixel_format` (int, optional): Input image pixel format. Default: espdl.RGB888
8989
- `features` (bool, optional): Whether to return facial feature points. Default: True
9090

9191
#### Methods
@@ -109,13 +109,13 @@ The FaceRecognizer module manages a database of faces and can recognize previous
109109

110110
#### Constructor
111111
```python
112-
FaceRecognizer(width=320, height=240, pixel_format=DL_IMAGE_PIX_TYPE_RGB888, features=True, db_path="face.db", model=None)
112+
FaceRecognizer(width=320, height=240, pixel_format=espdl.RGB888, features=True, db_path="face.db", model=None)
113113
```
114114

115115
**Parameters:**
116116
- `width` (int, optional): Input image width. Default: 320
117117
- `height` (int, optional): Input image height. Default: 240
118-
- `pixel_format` (int, optional): Input image pixel format. Default: DL_IMAGE_PIX_TYPE_RGB888
118+
- `pixel_format` (int, optional): Input image pixel format. Default: espdl.RGB888
119119
- `features` (bool, optional): Whether to return facial feature points. Default: True
120120
- `db_path` (str, optional): Path to the face database file. Default: "face.db"
121121
- `model` (str, optional): Feature extraction model to use ("MBF" or "MFN"). Default: None (uses default model)
@@ -168,13 +168,13 @@ The HumanDetector module detects people in images. The CatDetector does it for c
168168

169169
#### Constructor
170170
```python
171-
HumanDetector(width=320, height=240, pixel_format=DL_IMAGE_PIX_TYPE_RGB888) #For cats use CatDetector
171+
HumanDetector(width=320, height=240, pixel_format=espdl.RGB888) #For cats use CatDetector
172172
```
173173

174174
**Parameters:**
175175
- `width` (int, optional): Input image width. Default: 320
176176
- `height` (int, optional): Input image height. Default: 240
177-
- `pixel_format` (int, optional): Input image pixel format. Default: DL_IMAGE_PIX_TYPE_RGB888
177+
- `pixel_format` (int, optional): Input image pixel format. Default: espdl.RGB888
178178

179179
#### Methods
180180

@@ -196,13 +196,13 @@ The ImageNet module classifies images into predefined categories.
196196

197197
#### Constructor
198198
```python
199-
ImageNet(width=320, height=240, pixel_format=DL_IMAGE_PIX_TYPE_RGB888)
199+
ImageNet(width=320, height=240, pixel_format=espdl.RGB888)
200200
```
201201

202202
**Parameters:**
203203
- `width` (int, optional): Input image width. Default: 320
204204
- `height` (int, optional): Input image height. Default: 240
205-
- `pixel_format` (int, optional): Input image pixel format. Default: DL_IMAGE_PIX_TYPE_RGB888
205+
- `pixel_format` (int, optional): Input image pixel format. Default: espdl.RGB888
206206

207207
#### Methods
208208

@@ -223,13 +223,13 @@ The COCO detect module detects objects in images using the COCO dataset.
223223

224224
#### Constructor
225225
```python
226-
COCODetector(width=320, height=240, pixel_format=DL_IMAGE_PIX_TYPE_RGB888, model=CONFIG_DEFAULT_COCO_DETECT_MODEL)
226+
COCODetector(width=320, height=240, pixel_format=espdl.RGB888, model=CONFIG_DEFAULT_COCO_DETECT_MODEL)
227227
```
228228

229229
**Parameters:**
230230
- `width` (int, optional): Input image width. Default: 320
231231
- `height` (int, optional): Input image height. Default: 240
232-
- `pixel_format` (int, optional): Input image pixel format. Default: DL_IMAGE_PIX_TYPE_RGB888
232+
- `pixel_format` (int, optional): Input image pixel format. Default: espdl.RGB888
233233
- `model` (int, optional): COCO detection model to use. Default: CONFIG_DEFAULT_COCO_DETECT_MODEL
234234

235235
#### Methods

esp-dl

src/mp_esp_dl_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
static const mp_rom_map_elem_t module_globals_table[] = {
55
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espdl) },
6+
{ MP_ROM_QSTR(MP_QSTR_RGB888), MP_ROM_INT(0)},
7+
{ MP_ROM_QSTR(MP_QSTR_RGB565), MP_ROM_INT(6)},
8+
{ MP_ROM_QSTR(MP_QSTR_GRAYSCALE), MP_ROM_INT(3)},
69
#if MP_DL_FACE_DETECTOR_ENABLED
710
{ MP_ROM_QSTR(MP_QSTR_FaceDetector), MP_ROM_PTR(&mp_face_detector_type) },
811
#endif

0 commit comments

Comments
 (0)