Skip to content

Commit

Permalink
Updated copy around Image Processing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajay Maurya authored and Ajay Maurya committed Jan 6, 2022
1 parent 5cbcbf6 commit 03a4175
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Note that [Computer Vision](https://docs.microsoft.com/en-us/azure/cognitive-ser
- In the `API Key` field, enter your `KEY 1`.

#### 3. Enable specific Image Processing features
- Choose to `Automatically Caption Images`, `Automatically Tag Images`, `Enable smart cropping`, and/or `Enable OCR`.
- Choose to `Automatically Tag Images`, `Automatically Tag Images`, `Enable smart cropping`, and/or `Enable OCR`.
- For features that have thresholds or taxonomy settings, set those as well.

#### 4. Save Image or PDF file or run WP CLI command to batch classify your content
Expand Down
12 changes: 6 additions & 6 deletions includes/Classifai/Providers/Azure/ComputerVision.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function setup_attachment_meta_box( $post ) {
*/
public function attachment_data_meta_box( $post ) {
$settings = get_option( 'classifai_computer_vision' );
$captions = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ) ? __( 'Rescan Alt Text', 'classifai' ) : __( 'Scan Alt Text', 'classifai' );
$captions = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ) ? __( 'ReGenerate Tags', 'classifai' ) : __( 'Generate Tags', 'classifai' );
$tags = ! empty( wp_get_object_terms( $post->ID, 'classifai-image-tags' ) ) ? __( 'Rescan Tags', 'classifai' ) : __( 'Generate Tags', 'classifai' );
$ocr = get_post_meta( $post->ID, 'classifai_computer_vision_ocr', true ) ? __( 'Rescan Text', 'classifai' ) : __( 'Scan Text', 'classifai' );
$smart_crop = get_transient( 'classifai_azure_computer_vision_smart_cropping_latest_response' ) ? __( 'Regenerate Smart Thumbnail', 'classifai' ) : __( 'Generate Smart Thumbnail', 'classifai' );
Expand Down Expand Up @@ -748,7 +748,7 @@ public function setup_fields_sections() {
'label_for' => 'url',
'input_type' => 'text',
'default_value' => $default_settings['url'],
'description' => __( 'e.g. <code>https://REGION.api.cognitive.microsoft.com/</code>', 'classifai' ),
'description' => __( 'e.g. <code>https://REGION.api.cognitive.microsoft.com/</code> or <code>https://EXAMPLE.cognitiveservices.azure.com</code>', 'classifai' ),
]
);
add_settings_field(
Expand All @@ -765,28 +765,28 @@ public function setup_fields_sections() {
);
add_settings_field(
'enable-image-captions',
esc_html__( 'Automatically Caption Images', 'classifai' ),
esc_html__( 'Automatically Tag Images', 'classifai' ),
[ $this, 'render_input' ],
$this->get_option_name(),
$this->get_option_name(),
[
'label_for' => 'enable_image_captions',
'input_type' => 'checkbox',
'default_value' => $default_settings['enable_image_captions'],
'description' => __( 'Images will be captioned with alt text upon upload', 'classifai' ),
'description' => __( 'Images will be tagged upon upload', 'classifai' ),
]
);
add_settings_field(
'caption-threshold',
esc_html__( 'Caption Confidence Threshold', 'classifai' ),
esc_html__( 'Tag Confidence Threshold', 'classifai' ),
[ $this, 'render_input' ],
$this->get_option_name(),
$this->get_option_name(),
[
'label_for' => 'caption_threshold',
'input_type' => 'number',
'default_value' => $default_settings['caption_threshold'],
'description' => __( 'Minimum confidence score for automatically applied image captions, numeric value from 0-100. Recommended to be set to at least 75.', 'classifai' ),
'description' => __( 'Minimum confidence score for automatically applied image tags, numeric value from 0-100. Recommended to be set to at least 70.', 'classifai' ),
]
);
add_settings_field(
Expand Down
14 changes: 7 additions & 7 deletions languages/classifai.pot
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ msgid "ClassifAI PDF Processing"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:239
msgid "Rescan Alt Text"
msgid "ReGenerate Tags"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:239
msgid "Scan Alt Text"
msgid "Generate Tags"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:240
Expand Down Expand Up @@ -133,19 +133,19 @@ msgid "In progress!"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:751
msgid "e.g. <code>https://REGION.api.cognitive.microsoft.com/</code>"
msgid "e.g. <code>https://REGION.api.cognitive.microsoft.com/</code> or <code>https://EXAMPLE.cognitiveservices.azure.com</code>"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:768
msgid "Automatically Caption Images"
msgid "Automatically Tag Images"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:776
msgid "Images will be captioned with alt text upon upload"
msgid "Images will be tagged upon upload"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:781
msgid "Caption Confidence Threshold"
msgid "Tag Confidence Threshold"
msgstr ""

#: includes/Classifai/Providers/Azure/ComputerVision.php:789
Expand Down Expand Up @@ -636,4 +636,4 @@ msgstr ""
#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p6/Plugin/Ui.php:217
msgctxt "the plugin title"
msgid "Could not determine if updates are available for %s."
msgstr ""
msgstr ""
4 changes: 2 additions & 2 deletions tests/e2e/wpacceptance/ImageProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function testGenerateCheckboxesShows() {

$I->seeText( 'ClassifAI Image Processing' );

$I->seeText( 'Scan Alt Text' );
$I->seeText( 'Generate Tags' );

$I->seeText( 'Generate Tags' );
}
Expand All @@ -62,6 +62,6 @@ public function testRescanCheckboxesShows() {

$I->seeText( 'ClassifAI Image Processing' );

$I->seeText( 'Rescan Alt Text' );
$I->seeText( 'ReGenerate Tags' );
}
}
2 changes: 1 addition & 1 deletion tests/e2e/wpacceptance/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function testComputerVisionSettingsShows() {

$I->seeText( 'Computer Vision' );

$I->seeText( 'Automatically Caption Images' );
$I->seeText( 'Automatically Tag Images' );
}
}

0 comments on commit 03a4175

Please sign in to comment.