Coder Social home page Coder Social logo

symisc / sod Goto Github PK

View Code? Open in Web Editor NEW
1.7K 89.0 209.0 3.5 MB

An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)

Home Page: https://sod.pixlab.io

License: Other

C 99.47% Makefile 0.04% HTML 0.50%
computer-vision library deep-learning image-processing object-detection c cpu real-time convolutional-neural-networks face-detection

sod's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sod's Issues

About pre-trained modules

I just failed to access the download page of pre-trained modules (url like pixlab.io/download), anybody could help me ?

Not an issue

How should we convert an AVFrame (ffmpeg decoding result in RGB format) to sod_img ?

Target HW

Hello everyone,

Firstly great thanks for work. And second,

What exactly sod is?

SOD Model unable to open

Getting error when running Face detection.

"Cannot open SOD model"

It is not described what this error means and how to solve it. Would be great to know.


`CC = clang
CFLAGS = -lm -Ofast -march=native -Wall -std=c99

sod: sod.c
	$(CC) sod.c samples/cnn_face_detection.c -o sod_face_detect -I. $(CFLAGS)`

The problem of training samples

What are the requirements of the SOD training model for samples? How do we deal with the positive and negative samples? Are there any restrictions on the size and so on?

Memory allocating

I was trying to use SOD for plate detection.
At the code, you are using malloc for allocating memory, but not carry about "value" that is "filled" at the allocated space. For example, in sod.c:10828(sod_canny_edge_image) you allocate memory for variable "dir" and then using it in some functions. At sod.c:10521 you are using this variable "dir" with comparing of elements, contained at "dir" with 0, 1, 2 and 3-int values at the switch/case construction. It's not correct, because at the allocated memory can be garbage with different values.
When I was using VisualStudio program was working OK, but not for MinGW: MinGW set allocated memory to "0"-values and I catch a SEGFAULT signal.
So if I paste after allocating memory
memset(dir, INT_MIN, im.w * im.h * sizeof(int));
All is working OK at the different compilers. So my suggestion is to use memset always after allocating memory.
Additional info:
OS Windows 10, Compiler - g++ (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 7.2.0.

About disable SSE2

Hi,
I'm working on the project that is going to integrate the sod as a benchmark. Unfortunately, we are blocked at the compilation stage, our environment set up let us we can't support SSE2. We have plenty of error regarding:
for example:
always_inline function '_mm_load_si128' requires target feature 'sse2', but would be inlined into function 'stbi__idct_simd' that is compiled without support for 'sse2'
is that possible there is some alternative function as _mm_load_si128 _mm_set1_epi32 _mm_set1_epi16, etc. It is inside the sod_img_reader.h.

The function of the training model has a BUG

I set up the positive sample and negative sample path and add the training file in two directories, the first positive sample load is no problem, but the second negative sample load appears "IO error while entering directory" error, I try to adjust the code in sod.c, "detector_layer_exec" in "DetectorCollec". TSamples (pDet, pPath->sPosPath.zString, SOD_TR_SAMPLE_POS, pPath->recurse, 0) "and" DetectorCollectSamples (pDet, pPath->sNegPath.zString, SOD_TR_SAMPLE_NEG, pPath->recurse, 0) "position,The final result is that the negative sample is loaded successfully, but the positive sample loading fails, prompting the error of "IO error while entering directory", and this is not a heap overflow problem caused by "FindFirstFileW".

realnet_train_model

Parsing done. Processing network layers now..

Processing layer: 'paths'..

Processing layer: 'detector'..

Collecting positive samples..

Entering directory: 'pedestrian_dataset/positives'..

Over 300 positive samples were collected so far..

Over 600 positive samples were collected so far..

Over 900 positive samples were collected so far..

Over 1200 positive samples were collected so far..

Over 1500 positive samples were collected so far..

Over 1800 positive samples were collected so far..

Over 2100 positive samples were collected so far..

Over 2400 positive samples were collected so far..

Over 2700 positive samples were collected so far..

2908 positive samples were collected on directory: 'pedestrian_dataset/positives'

Collecting negative samples..

IO error while entering directory: 'pedestrian_dataset/background'

Adding benchmarks?

It would be interesting to see benchmarks (esp. on embedded devices like the RbP3 / RbP3+) of both the accuracy and the performance of the detectors (personally I am especially interested in the RealNets face detector/extractor) - this would also hopefully help guide people towards your product :)

CNN Face Detector Accuracy

Hi,

Before buying the model i just want to check the accuracy on my own dataset.

Q1. Does it work on linux ?
Q2. If you can share an .exe with a parameter as path of the video file i will check the accuracy.

Thanks.

Python bindings

Thank you for the great framework. s there any python bindings?

Possible to use RealNets for object detection?

Is it possible to use RealNets for object detection as sod_cnn interfaces do?

for example:
Train a model like "tiny20.sod" using sod_trainning interfaces.

And the model is used in sod_realnet_detect for 20-class object detection & classification.

How to work with video?

Does sod support video input and output? OpenCV doesn't support Iplimage anymore and I don't know how to convert from Iplimage to sod_img

Application/User Information

I think some more work is needed on the user/application information for different platforms to help get this great library into embedded systems . The information provided says its only required to add 4 c-files to a project but this is not the case since these files reference many .h files that are not included in many toolchains for example GNU eabi toolchain used with STM32CubeIDE. Thank you

Invalid read of size 4

Memory checking a program with valgrind returns an invalid read of size 4 in at line 10533 of sod.c.

Minimal example code :

#include <stdlib.h>
#include <math.h>
#include "sod.h"

int main(int argc, char *argv[]) {
	const char *zInput = argv[1];
	sod_img imgIn = sod_img_load_grayscale(zInput);
	sod_img cannyImg = sod_canny_edge_image(imgIn, 0);
	sod_free_image(cannyImg);
	return 0;
}

Valgrind output after compilation in Ubuntu 18.04 amd 64 :

==17492== Invalid read of size 4
==17492==    at 0x1286F8: canny_non_max_suppression (sod.c:10533)
==17492==    by 0x129D0E: sod_canny_edge_image (sod.c:10832)
==17492==    by 0x10B534: main (minimal.c:8)
==17492==  Address 0x4d57f00 is 0 bytes after a block of size 473,600 alloc'd
==17492==    at 0x483AB35: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==17492==    by 0x1234A3: sod_make_image (sod.c:9190)
==17492==    by 0x129C67: sod_canny_edge_image (sod.c:10827)
==17492==    by 0x10B534: main (minimal.c:8)
==17492== 

Single channel/Gray scale depth not working

Hi,

I am trying out some processing with grayscale and black and white images, I find some problems with channel depth in some functions.

I am using Windows 7 and the GNU compiler with Codeblocks as IDE.

When using sod_img_blob_save_as_bmp() with channels set to 1, the output still contains 3 channels. Below is some code I used to test this.

`
sod_img imgIn = sod_img_load_from_file(zInput,SOD_IMG_GRAYSCALE); //

/* Perform canny edge detection. */
sod_img imgOut = sod_canny_edge_image(imgIn, 0 );

    /* Finally save our processed image to the specified path */
/* first make it a blob so we can use bmp saving)
unsigned char *zPng = sod_image_to_blob(imgOut);
sod_img_blob_save_as_bmp(zOut, zPng, 240, 240, 1  );

`

Does this library help in drawing the bounding boxes ?

Hi,
Ive a set of bounding box coordinates of objects inside a 1 minute video file.
I would like to draw these bounding boxes and display them over video file smoothly.
My hardware is RaspberryPi4.
Will SOD work for drawing bounding boxes ? And is it faster ?
Also is there any example of SOD for basic video processing ?

how to train realnet face detection

I want to train realnet face detection I have downloaded genki4k data set want to train the model and test the accuracy but this pedestrian detector is looking as object classification not object detection for face detection its object detection so how can i train objection on real net
what I mean is I have trained many object detection and everyone requires object coordinates (means bounding box, lable image) but on this tutorial there is nothing like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.