-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add rosetta model support #340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check the indentation and code style guide:
https://developer.ridgerun.com/wiki/index.php?title=RidgeRun_Developer_Manual/Coding_Styles/C
@@ -61,6 +61,18 @@ gboolean gst_subtract_mean(GstVideoFrame * inframe, GstVideoFrame * outframe, gd | |||
|
|||
gboolean gst_pixel_to_float(GstVideoFrame * inframe, GstVideoFrame * outframe, gint model_channels); | |||
|
|||
/** | |||
* \brief Normalize the image to match the Rosetta input tensor requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not introduce Rosetta
into generic modules. Let's keep it as:
"Normalize grayscale image the image within a given mean and offset"
ext/r2inference/gstrosetta.c
Outdated
#include "config.h" | ||
#endif | ||
|
||
#include "stdio.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort the includes appropriately. Check the includes order here: https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
ext/r2inference/gstrosetta.c
Outdated
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' | ||
}; | ||
char *final_phrase = | ||
(char *) malloc (sizeof (char) * (MODEL_OUTPUT_ROWS) + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer glib functions for memory allocation too (i.e g_malloc0, g_free, etc)
ext/r2inference/gstrosetta.c
Outdated
|
||
free (output); | ||
return TRUE; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line
gst_apply_gray_normalization (GstVideoFrame * inframe, GstVideoFrame * outframe, | ||
gdouble mean, gdouble offset) | ||
{ | ||
gint i, j, pixel_stride, width, height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize these variables.
ext/r2inference/gstrosetta.c
Outdated
// Checking if the actual max index value is different from '_' character | ||
// and also, checking if i is greater than 0, and finally, checking | ||
//if the actual max index is equal from the previous one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a comment style only. GStreamer uses ANSI-C /* */
ext/r2inference/gstrosetta.c
Outdated
"Rosetta", "Filter", | ||
"Infers characters from an incoming image", | ||
"Edgar Chaves <edgar.chaves@ridgerun.com>\n\t\t\t" | ||
" Luis Leon <luis.leon@ridgerun.com>\n\t\t\t"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the last \n\t\t\t
and the spaces at the beginning
836af22
to
8125d08
Compare
Add the support for Rosetta model for character recognition.