precision-sustainable-ag / PlantMap3D-Computer-Vision

4 stars 0 forks source link

Code needs refactoring to be able to integrate with ROS wrappers #3

Open MathewAaron opened 1 year ago

MathewAaron commented 1 year ago

@Djyankencsu : I tested the code and it works!

Next, I would like you to refactor your code so it can be scaled, reused and optimized. you can reference script as an example of how you can refactor your code.

Just to make things a little easy for me please use tabs to indent your code and change variable names to what it clearly describes for example cam_data can be written as rgb_data and nn_out = segmantion_labels. Thanks.

Djyankencsu commented 1 year ago

Since it works now, I will go through and clean up the code and improve its readability. I think my editor added those weird indentations back into the script after I manually removed them, so I will try using a different editor from now on. I will also remove the color mapping so that the segmentation outputs are of the shape: (height, width, 1).

Djyankencsu commented 1 year ago

@MathewAaron I have refactored the code based on the script you shared. There is one extraneous variable still that will not be important for the eventual ROS integration, which is just the boolean is_usb_cam and its derivatives within the class declaration. Just manually set that to false on your end before testing with a POE camera. I will add back in comments that document the flow of the updated structure next.