mirror of
https://github.com/esimov/pigo.git
synced 2025-10-05 16:16:55 +08:00
fixed typo across the project
This commit is contained in:
@@ -153,7 +153,7 @@ func TestFlploc_LandmarkPointsDetectorShouldReturnCorrectDetectionPoints(t *test
|
||||
|
||||
}
|
||||
}
|
||||
expectedLandmarkPoints := 2*len(eyeCascades) + len(mouthCascades) + 1
|
||||
expectedLandmarkPoints := 2*len(eyeCascades) + len(mouthCascades) + 1 // lendmark points of the left/right eyes, mouth + nose
|
||||
if expectedLandmarkPoints != detectedLandmarkPoints {
|
||||
t.Fatalf("expected facial landmark points to be detected: %d, got: %d", expectedLandmarkPoints, detectedLandmarkPoints)
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
|
||||
coords := make([]int, 0, len(dets))
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range dets {
|
||||
coords = append(coords, v...)
|
||||
|
@@ -22,7 +22,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough C types.
|
||||
# Obtain the camera pixels and transfer them to Go through C types.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(ARRAY_DIM * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -19,7 +19,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes.
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(3 * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -19,7 +19,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes.
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(3 * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -34,7 +34,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
|
||||
det := make([]int, 0, len(result))
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range result {
|
||||
det = append(det, v...)
|
||||
|
@@ -95,7 +95,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
coords := make([]int, 0, len(dets))
|
||||
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range dets {
|
||||
coords = append(coords, v...)
|
||||
|
@@ -20,7 +20,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes.
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(ARRAY_DIM * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -59,7 +59,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
|
||||
coords := make([]int, 0, len(dets))
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range dets {
|
||||
coords = append(coords, v...)
|
||||
|
@@ -20,7 +20,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes.
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(ARRAY_DIM * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -70,7 +70,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
|
||||
coords := make([]int, 0, len(dets))
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range dets {
|
||||
coords = append(coords, v...)
|
||||
|
@@ -34,7 +34,7 @@ def rotateImage(image, angle):
|
||||
|
||||
return result
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes.
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes.
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(ARRAY_DIM * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -119,7 +119,7 @@ func FindFaces(pixels []uint8) uintptr {
|
||||
coords := make([]int, 0, len(dets))
|
||||
|
||||
go func() {
|
||||
// Since in Go we cannot transfer a 2d array trough an array pointer
|
||||
// Since in Go we cannot transfer a 2d array through an array pointer
|
||||
// we have to transform it into 1d array.
|
||||
for _, v := range dets {
|
||||
coords = append(coords, v...)
|
||||
|
@@ -47,7 +47,7 @@ class GoPixelSlice(Structure):
|
||||
("pixels", POINTER(c_ubyte)), ("len", c_longlong), ("cap", c_longlong),
|
||||
]
|
||||
|
||||
# Obtain the camera pixels and transfer them to Go trough Ctypes
|
||||
# Obtain the camera pixels and transfer them to Go through Ctypes
|
||||
def process_frame(pixs):
|
||||
dets = np.zeros(ARRAY_DIM * MAX_NDETS, dtype=np.float32)
|
||||
pixels = cast((c_ubyte * len(pixs))(*pixs), POINTER(c_ubyte))
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## Webcam demo (slow)
|
||||
|
||||
This demo shows how we can transfer the webcam frames from Python to Go by sending the captured frames as byte array into the standard output.
|
||||
We will run the face detector over the byte arrays received from the standard output and send the result into a web browser trough a webserver.
|
||||
We will run the face detector over the byte arrays received from the standard output and send the result into a web browser through a webserver.
|
||||
|
||||
### Run
|
||||
|
||||
|
@@ -17,7 +17,7 @@ $ GOOS=js GOARCH=wasm go build -o lib.wasm wasm.go
|
||||
```
|
||||
### Supported keys:
|
||||
<kbd>s</kbd> - Show/hide pupils<br/>
|
||||
<kbd>c</kbd> - Circle trough the detection shape types (`rectangle`|`circle`|`ellipse`)<br/>
|
||||
<kbd>c</kbd> - Circle through the detection shape types (`rectangle`|`circle`|`ellipse`)<br/>
|
||||
<kbd>f</kbd> - Show/hide facial landmark points (hidden by default)
|
||||
|
||||
## Demos
|
||||
|
@@ -23,7 +23,7 @@ func NewDetector() *Detector {
|
||||
return &d
|
||||
}
|
||||
|
||||
// FetchCascade retrive the cascade file trough a JS http connection.
|
||||
// FetchCascade retrive the cascade file through a JS http connection.
|
||||
// It should return the binary data as uint8 integers or err in case of an error.
|
||||
func (d *Detector) FetchCascade(url string) ([]byte, error) {
|
||||
d.respChan = make(chan []uint8)
|
||||
|
Reference in New Issue
Block a user