File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed
Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -759,6 +759,30 @@ Blockly.Python['coderbot_adv_cnn_classify'] = function(block) {
759759 return [ class_scores , Blockly . Python . ORDER_ATOMIC ] ;
760760} ;
761761
762+ Blockly . Blocks [ 'coderbot_adv_cnn_detect_objects' ] = {
763+ /**
764+ * Block for find_class function.
765+ * @this Blockly.Block
766+ */
767+ init : function ( ) {
768+ this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
769+ this . setColour ( 250 ) ;
770+ this . appendDummyInput ( )
771+ . appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDOBJECTS )
772+ . appendField ( new Blockly . FieldDropdown ( CODERBOT_CNN_MODEL_LIST ) , 'MODEL' ) ;
773+ this . setInputsInline ( true ) ;
774+ this . setOutput ( true , [ 'Array' ] ) ;
775+ this . setTooltip ( Blockly . Msg . LOGIC_BOOLEAN_TOOLTIP ) ;
776+ }
777+ } ;
778+
779+ Blockly . Python [ 'coderbot_adv_cnn_detect_objects' ] = function ( block ) {
780+ var model = block . getFieldValue ( 'MODEL' ) ;
781+ var class_scores = 'get_cam().cnn_detect_objects("' + model + '")' ;
782+ return [ class_scores , Blockly . Python . ORDER_ATOMIC ] ;
783+ } ;
784+
785+
762786Blockly . Blocks [ 'coderbot_event_generator' ] = {
763787 init : function ( ) {
764788 this . appendDummyInput ( )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Blockly.Msg.CODERBOT_SENSOR_FINDFACE_SIZE = "size";
5252Blockly . Msg . CODERBOT_SENSOR_FINDFACE_ALL = "x, y, size (as list)" ;
5353Blockly . Msg . CODERBOT_SENSOR_FINDLOGO = "find logo" ;
5454Blockly . Msg . CODERBOT_SENSOR_FINDCLASS = "find class" ;
55+ Blockly . Msg . CODERBOT_SENSOR_FINDOBJECTS = "find objects" ;
5556Blockly . Msg . CODERBOT_SENSOR_AVERAGE = "get image average" ;
5657Blockly . Msg . CODERBOT_SENSOR_AVERAGE_HUE = "Hue" ;
5758Blockly . Msg . CODERBOT_SENSOR_AVERAGE_SATURATION = "Saturation" ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Blockly.Msg.CODERBOT_SENSOR_FINDFACE_SIZE = "dimensione";
5252Blockly . Msg . CODERBOT_SENSOR_FINDFACE_ALL = "x, y, dimensione (come lista)" ;
5353Blockly . Msg . CODERBOT_SENSOR_FINDLOGO = "trova logo" ;
5454Blockly . Msg . CODERBOT_SENSOR_FINDCLASS = "trova classe" ;
55+ Blockly . Msg . CODERBOT_SENSOR_FINDOBJECTS = "trova oggetti" ;
5556Blockly . Msg . CODERBOT_SENSOR_AVERAGE = "valore medio immagine" ;
5657Blockly . Msg . CODERBOT_SENSOR_AVERAGE_HUE = "Tinta" ;
5758Blockly . Msg . CODERBOT_SENSOR_AVERAGE_SATURATION = "Saturazione" ;
Original file line number Diff line number Diff line change 303303 <block type =" coderbot_adv_findARCode" ></block >
304304 <block type =" coderbot_adv_find_class" ></block >
305305 <block type =" coderbot_adv_cnn_classify" ></block >
306+ <block type =" coderbot_adv_cnn_detect_objects" ></block >
306307 <block type =" coderbot_sonar_get_distance" ></block >
307308 </category >{%endif%}
308309 <category name =" {% trans %}Sound{% endtrans %}" colour =" 220" >
You can’t perform that action at this time.
0 commit comments