view release on metacpan or search on metacpan
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
bin/Inception.pl view on Meta::CPAN
host => $self->host,
port => $self->port
);
$client->model_name($self->model_name);
$client->model_signature($self->model_signature);
$client->debug_verbose($self->debug_verbose);
$client->loopback($self->debug_loopback_interface);
$client->camel($self->debug_camel);
printf("Sending image %s to server at host:%s port:%s\n",
$self->image_file, $self->host, $self->port);
if ($client->call_inception($image_ref)) {
my $results_ref = $client->inception_results;
my $classifications_ref = $results_ref->{'classes'};
my $scores_ref = $results_ref->{'scores'};
my $comments = 'Clasification Results for ' . $self->image_file;
my $results_text
bin/Inception.pl view on Meta::CPAN
'.===========================================================================.',
'| Class | Score |',
'|-----------------------------------------------------------+---------------|',
'| {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[} |{]].[[[[[[[[} |',
$classifications_ref, $scores_ref,
'|===========================================================================|',
'| {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[} |',
$comments,
"'==========================================================================='";
print $results_text;
} else {
printf("Failed. Status: %s, Status Code: %s, Status Message: %s \n",
$client->status, $client->status_code, $client->status_message);
return 1;
}
return 0;
}
sub read_image {
my $self = shift;
return \'' if $self->debug_camel;
lib/AI/PredictionClient/CPP/PredictionGrpcCpp.pm view on Meta::CPAN
PredictionClient::PredictionClient(std::string server_port)
: stub_(PredictionService::NewStub(grpc::CreateChannel(
server_port, grpc::InsecureChannelCredentials()))) {}
std::string PredictionClient::callPredict(std::string serialized_request_object) {
PredictRequest predictRequest;
PredictResponse response;
ClientContext context;
std::string serialized_result_object;
google::protobuf::util::JsonPrintOptions jprint_options;
google::protobuf::util::JsonParseOptions jparse_options;
google::protobuf::util::Status request_serialized_status =
google::protobuf::util::JsonStringToMessage(
serialized_request_object, &predictRequest, jparse_options);
if (!request_serialized_status.ok()) {
std::string error_result =
"{\"Status\": \"Error:object:request_deserialization:protocol_buffers\", ";
error_result += "\"StatusCode\": \"" +
lib/AI/PredictionClient/CPP/PredictionGrpcCpp.pm view on Meta::CPAN
to_base64(request_serialized_status.error_message()) +
"}";
return error_result;
}
Status status = stub_->Predict(&context, predictRequest, &response);
if (status.ok()) {
google::protobuf::util::Status response_serialize_status =
google::protobuf::util::MessageToJsonString(
response, &serialized_result_object, jprint_options);
if (!response_serialize_status.ok()) {
std::string error_result =
"{\"Status\": \"Error:object:response_serialization:protocol_buffers\", ";
error_result += "\"StatusCode\": \"" +
std::to_string(response_serialize_status.error_code()) +
"\", ";
error_result += "\"StatusMessage\":" +
to_base64(response_serialize_status.error_message()) +
"}";
lib/AI/PredictionClient/CPP/PredictionGrpcCpp.pm view on Meta::CPAN
"\"StatusCode\": \"" + std::to_string(status.error_code()) + "\", ";
error_result += "\"StatusMessage\":" + to_base64(status.error_message()) + "}";
return error_result;
}
}
std::string PredictionClient::to_base64(std::string text) {
base64::Base64Proto base64pb;
std::string serialized_base64_message;
google::protobuf::util::JsonPrintOptions jprint_options;
base64pb.add_base64(text.c_str(), text.size());
google::protobuf::util::MessageToJsonString(
base64pb, &serialized_base64_message, jprint_options);
return serialized_base64_message;
}
lib/AI/PredictionClient/Roles/PredictionRole.pm view on Meta::CPAN
has status => (is => 'rwp',);
has status_code => (is => 'rwp',);
has status_message => (is => 'rwp',);
sub serialize_request {
my $self = shift;
printf("Debug - Request: %s \n", Dumper(\$self->request_ds))
if $self->debug_verbose;
my $json = JSON->new;
my $request_json = $json->encode($self->request_ds);
printf("Debug - JSON Request: %s \n", Dumper(\$request_json))
if $self->debug_verbose;
return $request_json;
}
sub deserialize_reply {
my $self = shift;
my $serialized_return = shift;
printf("Debug - JSON Response: %s \n", Dumper(\$serialized_return))
if $self->debug_verbose;
my $json = JSON->new;
my $returned_ds = $json->decode(
ref($serialized_return) ? $$serialized_return : $serialized_return);
$self->_set_status($returned_ds->{'Status'});
$self->_set_status_code($returned_ds->{'StatusCode'});
my $message_base = $returned_ds->{'StatusMessage'};
my $message
= ref($message_base)
? decode_base64($message_base->{'base64'}->[0])
: $message_base;
$self->_set_status_message($message ? $message : "");
$self->_set_reply_ds($returned_ds->{'Result'});
printf("Debug - Response: %s \n", Dumper(\$returned_ds))
if $self->debug_verbose;
if ($self->status =~ /^OK/i) {
return 1;
}
return 0;
}
1;
t/author-critic.t view on Meta::CPAN
#!perl
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
print qq{1..0 # SKIP these tests are for testing by the author\n};
exit
}
}
use strict;
use warnings;
use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc";
all_critic_ok();
t/author-pod-spell.t view on Meta::CPAN
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
print qq{1..0 # SKIP these tests are for testing by the author\n};
exit
}
}
use strict;
use warnings;
use Test::More;
# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007004
use Test::Spelling 0.12;
t/author-pod-syntax.t view on Meta::CPAN
#!perl
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
print qq{1..0 # SKIP these tests are for testing by the author\n};
exit
}
}
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
use strict; use warnings;
use Test::More;
use Test::Pod 1.41;
all_pod_files_ok();
t/release-minimum-version.t view on Meta::CPAN
#!perl
BEGIN {
unless ($ENV{RELEASE_TESTING}) {
print qq{1..0 # SKIP these tests are for release candidate testing\n};
exit
}
}
use Test::More;
eval "use Test::MinimumVersion";
plan skip_all => "Test::MinimumVersion required for testing minimum versions"
if $@;