Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Alejandro Zurcher zurche

👋
View GitHub Profile
View LogoResponse.java
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class LogoResponse {
@SerializedName("responses")
@Expose
private List<Response> responses = null;
View LogoBodyModel.java
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class LogoBodyModel {
@SerializedName("requests")
@Expose
private List<Request> requests = null;
View checkImage.java
LogoBodyModel logoBodyModel = LogoPostBuilder.buildLogoDetectionBody(encodedImage);
Call<LogoResponse> checkImageCall = mService.checkImageLogo(logoBodyModel);
checkImageCall.enqueue(new Callback<LogoResponse>() {
@Override
public void onResponse(Call<LogoResponse> call, Response<LogoResponse> response) {
Log.d(TAG, "Got Response");
if(response.body().getResponses() != null &&
response.body().getResponses().get(0).getLogoAnnotations() != null) {
Log.d(TAG, "It's a: " + response.body().getResponses().get(0).getLogoAnnotations().get(0).getDescription());
View LogoPostBuilder.java
public class LogoPostBuilder {
public static LogoBodyModel buildLogoDetectionBody(String image) {
LogoBodyModel logoBodyModel = new LogoBodyModel();
ArrayList<Feature> features = new ArrayList<>();
features.add(new Feature("LOGO_DETECTION", 1));
Request requests = new Request();
requests.setFeatures(features);
View StackActions.java
public interface StackActions {
int size();
boolean isEmpty();
void push(Object objectToPush);
Object pop() throws LinkedListEmptyException;
View QueueActions.java
public interface QueueActions {
boolean isEmpty();
void reset();
void enqueue(Object o);
Object first() throws EmptyQueueException;
You can’t perform that action at this time.