-
Notifications
You must be signed in to change notification settings - Fork 472
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
Method for image transformation matrix generation (more evualtion needed) #2057
base: main
Are you sure you want to change the base?
Conversation
…iltin function name, and a simple test case to trace the namespace error from a function that is not yet fully implemented, also corrected wront initial test
… have five inputs and no longer a matrix with dimensions inside.
… exceptions to trace the necessary additions
…java, accessible through MultiReturnComplexMatrixBuiltinCPInstruction and LibCommonsMath in its own class LibMatrixIMGTransform
…n needs to be done though
…r on or depricate the original dml file all together
…rm_linearized.dml, img_transform_matrix.dml, img_transform_linearized.dml
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2057 +/- ##
=======================================
Coverage ? 68.91%
Complexity ? 40839
=======================================
Files ? 1442
Lines ? 161983
Branches ? 31471
=======================================
Hits ? 111634
Misses ? 41290
Partials ? 9059 ☔ View full report in Codecov by Sentry. |
evaluated performance based on 3 test runs each and internal vs execution via script for generating the transformation matrix, code of LibMatrixIMGTransform is cleaned up and ready to go, execution via image_matrix_transform possible and documented with particulars. Buxfixes for image_transform_linearized necessary as the base implementation is not working besides default parameters. |
….dml script, where it works for certain tests but not for others
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.
Overall, it looks good, however we have a bunch of cleanup elements to do before this can be merged. If you look at the comments, and resolve any, then feel free to mark the element as resolved.
@@ -85,7 +85,8 @@ m_img_transform_linearized = function(Matrix[Double] img_in, Integer out_w, Inte | |||
ind= matrix(seq(1,ncol(xs),1),1,ncol(xs)) | |||
z = table(xs, ind) | |||
output = ys%*%z | |||
|
|||
print(nrow(img_in)) | |||
print(ncol(img_in)) |
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 print statements in the DML scripts.
Furthermore, could we change this DML script to use your new builtin feature?
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.
is implemented since today, had to work out a problem
z = table(xs, ind) | ||
zMat = transMat | ||
isFillable = as.logical(as.double(min(index_vector) == 0)) | ||
} |
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.
add a newline in the end of files.
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.
file deleted, as img_transform_test is being used instead
|
||
m_img_transform_matrix = function(Matrix[Double] transMat, Integer orig_w, Integer orig_h, Integer out_w, Integer out_h) | ||
return (Matrix[Double] zMat, Matrix[Double] isFillable){ | ||
#orig_w = as.scalar(dimMat[1,2]) |
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.
we have a convention of 2 space indentations of our builtin scripts.
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.
done
# zMat transformation matrix to be multiplied with for the linearized image | ||
# transformation function (arbitrary naming) | ||
# isFillable returns a boolean which indicates if cells need to be filled (with fillvalue), | ||
in this case the image is extended, otherwise the original image is used |
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.
this line is missing the hashtag
@@ -0,0 +1,52 @@ | |||
#------------------------------------------------------------- |
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.
test scripts is not allowed in the builtin folder, please move this to the testing folder in /src/test/scripts/functions/builtin.
You can then source it and use the functionality without it having to be a dedicated builtin function.
programArgs = new String[]{"-nvargs", "transMat=" + input("transMat"), "dimMat=" + input("dimMat"), "out_file=" + output("B_x"), "--debug"}; | ||
|
||
|
||
runTest(true, fails, null, -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.
verify the results.
} | ||
|
||
|
||
} |
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.
newlne in the end.
|
||
transformed = img_transform_linearized(input, out_w, out_h, a, b, c, d, e, f, fill_value, s_cols, s_rows) | ||
#affineMat = matrix(0,rows=3, cols=3) |
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.
we need to clean these tests up, such that we do not have this commented code.
|
||
|
||
#print(toString(affineMat)) | ||
#print(toString(dimMat)) |
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.
and remove print statements not used.
|
||
#print(toString(zMat)) | ||
print(nrow(zMat)) | ||
print(ncol(zMat)) |
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 print statements not used.
if you address the comments, simply mark them as resolved. |
ok thanks, ill be back tonight do continue to implement improvements based on your feedback, thanks |
only intermedia push, some feedback is still not implemented, but the image_transform_linearized.dml script now uses internally implemented transformation matrix generation |
First implementation for a method to generate the transformation matrix is implemented and the code was already cleaned up. Multiple test cases implemented which work fine, but no "breaking cases" implemented yet. not yet part of any previous dml scrips (image_transform linearized). Within the script "image_transformation_matrix" a boolean can be changed to switch from dml script execution to internal execution.