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) {
759
759
return [ class_scores , Blockly . Python . ORDER_ATOMIC ] ;
760
760
} ;
761
761
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
+
762
786
Blockly . Blocks [ 'coderbot_event_generator' ] = {
763
787
init : function ( ) {
764
788
this . appendDummyInput ( )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Blockly.Msg.CODERBOT_SENSOR_FINDFACE_SIZE = "size";
52
52
Blockly . Msg . CODERBOT_SENSOR_FINDFACE_ALL = "x, y, size (as list)" ;
53
53
Blockly . Msg . CODERBOT_SENSOR_FINDLOGO = "find logo" ;
54
54
Blockly . Msg . CODERBOT_SENSOR_FINDCLASS = "find class" ;
55
+ Blockly . Msg . CODERBOT_SENSOR_FINDOBJECTS = "find objects" ;
55
56
Blockly . Msg . CODERBOT_SENSOR_AVERAGE = "get image average" ;
56
57
Blockly . Msg . CODERBOT_SENSOR_AVERAGE_HUE = "Hue" ;
57
58
Blockly . 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";
52
52
Blockly . Msg . CODERBOT_SENSOR_FINDFACE_ALL = "x, y, dimensione (come lista)" ;
53
53
Blockly . Msg . CODERBOT_SENSOR_FINDLOGO = "trova logo" ;
54
54
Blockly . Msg . CODERBOT_SENSOR_FINDCLASS = "trova classe" ;
55
+ Blockly . Msg . CODERBOT_SENSOR_FINDOBJECTS = "trova oggetti" ;
55
56
Blockly . Msg . CODERBOT_SENSOR_AVERAGE = "valore medio immagine" ;
56
57
Blockly . Msg . CODERBOT_SENSOR_AVERAGE_HUE = "Tinta" ;
57
58
Blockly . Msg . CODERBOT_SENSOR_AVERAGE_SATURATION = "Saturazione" ;
Original file line number Diff line number Diff line change 303
303
<block type =" coderbot_adv_findARCode" ></block >
304
304
<block type =" coderbot_adv_find_class" ></block >
305
305
<block type =" coderbot_adv_cnn_classify" ></block >
306
+ <block type =" coderbot_adv_cnn_detect_objects" ></block >
306
307
<block type =" coderbot_sonar_get_distance" ></block >
307
308
</category >{%endif%}
308
309
<category name =" {% trans %}Sound{% endtrans %}" colour =" 220" >
You can’t perform that action at this time.
0 commit comments