No public description
PiperOrigin-RevId: 563543098
This commit is contained in:
parent
6c38483b37
commit
80b762a281
|
@ -767,8 +767,8 @@ cc_library(
|
||||||
deps = [
|
deps = [
|
||||||
":gl_base",
|
":gl_base",
|
||||||
"//mediapipe/framework/port:logging",
|
"//mediapipe/framework/port:logging",
|
||||||
|
"@com_google_absl//absl/log:absl_check",
|
||||||
"@com_google_absl//absl/log:absl_log",
|
"@com_google_absl//absl/log:absl_log",
|
||||||
"@com_google_absl//absl/log:check",
|
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_absl//absl/strings:str_format",
|
"@com_google_absl//absl/strings:str_format",
|
||||||
],
|
],
|
||||||
|
|
|
@ -173,7 +173,7 @@ bool GlTextureBuffer::CreateInternal(const void* data, int alignment) {
|
||||||
// normal single-context behavior. E.g. if you do bind, delete, render,
|
// normal single-context behavior. E.g. if you do bind, delete, render,
|
||||||
// unbind, the object is not deleted until the unbind, and it waits for
|
// unbind, the object is not deleted until the unbind, and it waits for
|
||||||
// the render to finish.
|
// the render to finish.
|
||||||
DLOG_IF(ERROR, !glIsTexture(name_to_delete))
|
ABSL_DLOG_IF(ERROR, !glIsTexture(name_to_delete))
|
||||||
<< "Deleting invalid texture id: " << name_to_delete;
|
<< "Deleting invalid texture id: " << name_to_delete;
|
||||||
glDeleteTextures(1, &name_to_delete);
|
glDeleteTextures(1, &name_to_delete);
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "absl/log/absl_check.h"
|
||||||
#include "absl/log/absl_log.h"
|
#include "absl/log/absl_log.h"
|
||||||
#include "absl/log/check.h"
|
|
||||||
#include "absl/strings/str_format.h"
|
#include "absl/strings/str_format.h"
|
||||||
#include "absl/strings/str_join.h"
|
#include "absl/strings/str_join.h"
|
||||||
#include "absl/strings/str_split.h"
|
#include "absl/strings/str_split.h"
|
||||||
|
@ -67,7 +67,7 @@ std::string AddLineNumbers(const GLchar* source) {
|
||||||
std::string format = absl::StrFormat(
|
std::string format = absl::StrFormat(
|
||||||
"%%%ii %%s", static_cast<int>(ceilf(log10(1 + lines.size()))));
|
"%%%ii %%s", static_cast<int>(ceilf(log10(1 + lines.size()))));
|
||||||
auto parsed_format = absl::ParsedFormat<'i', 's'>::New(format);
|
auto parsed_format = absl::ParsedFormat<'i', 's'>::New(format);
|
||||||
CHECK(parsed_format);
|
ABSL_CHECK(parsed_format);
|
||||||
for (int n = 0; n < lines.size(); n++) {
|
for (int n = 0; n < lines.size(); n++) {
|
||||||
lines[n] = absl::StrFormat(*parsed_format, n + 1, lines[n]);
|
lines[n] = absl::StrFormat(*parsed_format, n + 1, lines[n]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,5 +26,6 @@ cc_library(
|
||||||
"//mediapipe/tasks/c/components/processors:classifier_options",
|
"//mediapipe/tasks/c/components/processors:classifier_options",
|
||||||
"//mediapipe/tasks/c/core:base_options",
|
"//mediapipe/tasks/c/core:base_options",
|
||||||
"//mediapipe/tasks/cc/text/text_classifier",
|
"//mediapipe/tasks/cc/text/text_classifier",
|
||||||
|
"@com_google_absl//absl/log:absl_log",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "absl/log/absl_log.h"
|
||||||
#include "mediapipe/tasks/c/components/containers/classification_result.h"
|
#include "mediapipe/tasks/c/components/containers/classification_result.h"
|
||||||
#include "mediapipe/tasks/c/components/processors/classifier_options.h"
|
#include "mediapipe/tasks/c/components/processors/classifier_options.h"
|
||||||
#include "mediapipe/tasks/c/core/base_options.h"
|
#include "mediapipe/tasks/c/core/base_options.h"
|
||||||
|
@ -44,7 +45,8 @@ TextClassifier* CppTextClassifierCreate(TextClassifierOptions options) {
|
||||||
|
|
||||||
auto classifier = TextClassifier::Create(std::move(cpp_options));
|
auto classifier = TextClassifier::Create(std::move(cpp_options));
|
||||||
if (!classifier.ok()) {
|
if (!classifier.ok()) {
|
||||||
LOG(ERROR) << "Failed to create TextClassifier: " << classifier.status();
|
ABSL_LOG(ERROR) << "Failed to create TextClassifier: "
|
||||||
|
<< classifier.status();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return classifier->release();
|
return classifier->release();
|
||||||
|
@ -55,7 +57,7 @@ bool CppTextClassifierClassify(void* classifier, char* utf8_str,
|
||||||
auto cpp_classifier = static_cast<TextClassifier*>(classifier);
|
auto cpp_classifier = static_cast<TextClassifier*>(classifier);
|
||||||
auto cpp_result = cpp_classifier->Classify(utf8_str);
|
auto cpp_result = cpp_classifier->Classify(utf8_str);
|
||||||
if (!cpp_result.ok()) {
|
if (!cpp_result.ok()) {
|
||||||
LOG(ERROR) << "Classification failed: " << cpp_result.status();
|
ABSL_LOG(ERROR) << "Classification failed: " << cpp_result.status();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CppConvertToClassificationResult(*cpp_result, result);
|
CppConvertToClassificationResult(*cpp_result, result);
|
||||||
|
@ -66,7 +68,7 @@ void CppTextClassifierClose(void* classifier) {
|
||||||
auto cpp_classifier = static_cast<TextClassifier*>(classifier);
|
auto cpp_classifier = static_cast<TextClassifier*>(classifier);
|
||||||
auto result = cpp_classifier->Close();
|
auto result = cpp_classifier->Close();
|
||||||
if (!result.ok()) {
|
if (!result.ok()) {
|
||||||
LOG(ERROR) << "Failed to close TextClassifier: " << result;
|
ABSL_LOG(ERROR) << "Failed to close TextClassifier: " << result;
|
||||||
}
|
}
|
||||||
delete cpp_classifier;
|
delete cpp_classifier;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user