You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-dev@incubator.apache.org by Subash Chaturanga <su...@gmail.com> on 2011/07/26 21:55:20 UTC

Problem with interacting among two SCA services.

Hi all,

I have an unexpected issues with my two services and I tried to resolve this
many times, but couldn't figure out a way. I use FacebookFriendFinder  and
FaceRecognitionService services. There, in FacebookFriendFinder impl, I use
 basic methods in FaceRecognitionService. In one occasion I call a method
 FaceRecognitionService.recognize() from  FacebookFriendFinder service it
doesn't return the expected return values(checked the results with a
pilot program).

In other words here is the sequence of service method calls i did.

1. FacebookFriendFinder.findMyFriends() ----> calls method in line 2
2. FaceRecognitionService.recognize() -----> impl of FaceRecognitionService
calls the face4j method as in line 3
3. face4j.DefaultClient.recognize() method.

I am not getting return values ofrom line 1 method.  But when I see, inside
the impl of FaceRecognitionService service, the corresponding method(method
in line 3) returns the expected values. But those values doesn't goes up in
the method hierarchy.

I have updated the JIRA with a patch [1] with the latest patch where I got
an unexpected issue with the services I created.

So can anybody try this by adding adam's facebook credentials and face api
keys to the patch [1].
(after applying the patch and filling credentials params in service impl
classes, go to gallery image and click on facebook button. It should give an
 alert with some value (no of recognized faces)).




[1] -
https://issues.apache.org/jira/secure/attachment/12487900/issuesWithServices.patch



-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89

Re: Problem with interacting among two SCA services.

Posted by Luciano Resende <lu...@gmail.com>.
On Wed, Aug 3, 2011 at 1:47 PM, Subash Chaturanga <su...@gmail.com> wrote:
> Revision 1153648 has the changes I made according to remove face4j native
> class in photark face service interfaces. As an initiative I have added most
> commonly used three custom bean classes to our interface instead of face4j
> classes. With the current implementation of the face service interface will
> enough for both my face apps. But I will also add TODOs regarding the bean
> classes which are yet to be implemented and replaced for face4j stuff in the
> interface (hence, for the moment, I will not reduce or re-factor the service
> interface). And will focus on finishing the two face apps before going in to
> above mentioned TODOs.
>

Great, great to see we are past the serialization issues and things
are back working again.



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: Problem with interacting among two SCA services.

Posted by Subash Chaturanga <su...@gmail.com>.
Revision 1153648 has the changes I made according to remove face4j native
class in photark face service interfaces. As an initiative I have added most
commonly used three custom bean classes to our interface instead of face4j
classes. With the current implementation of the face service interface will
enough for both my face apps. But I will also add TODOs regarding the bean
classes which are yet to be implemented and replaced for face4j stuff in the
interface (hence, for the moment, I will not reduce or re-factor the service
interface). And will focus on finishing the two face apps before going in to
above mentioned TODOs.

On Mon, Aug 1, 2011 at 2:39 AM, Subash Chaturanga <su...@gmail.com>wrote:

> Hi Luciano,
> As you said, this is the suggestion to a refactored interface definition
> for FaceRecognitionService interface.
>
> public void train(String uids);
> public void setFacebookOauth2(String fbUserId, String oauthToken);
> public void  removeTags(String tids) ;
> public void saveTags(String tids, String uid, String label);
> public Photo recognizeFromFile(File file, String uids);
> public Photo recognizeFromUrls(String urls, String uids);
> public Photo detectFromFile(String file);
> public Photo detectFromUrls(String urls);
> public void clearTwitterCreds();
> public void clearFacebookCreds();
>
> These are the most frequently methods which is used and which can be used
> in future in face apps. No need any return type from train method as we only
> need a void from it. But in the impl of this, we need a class called "Photo"
> which will behaves similar to org.face4j.Photo . Because in future face
> apps, when need to call these methods separately, we need to pass an
> instance of "Photo" which can keep "Faces" from detecting or recognizing
> images.
>
> Otherwise for the requirements of my two face apps, the above API can
> further reduced and even can make this such that "Photo" is no need as a
> return type. But in future one might need it for simplicity.
> WDYT?
>
> Thanks
>
> On Mon, Aug 1, 2011 at 1:02 AM, Luciano Resende <lu...@gmail.com>wrote:
>
>> On Tue, Jul 26, 2011 at 10:06 PM, Luciano Resende <lu...@gmail.com>
>> wrote:
>> > On Tue, Jul 26, 2011 at 9:23 PM, Subash Chaturanga <su...@gmail.com>
>> wrote:
>> >> FYI,
>> >> When I change the return type to String it works fine. But currently I
>> am
>> >> returning a face4j.Photo. Seems returning the type Photo from one
>> service
>> >> method to its parent method in another service is the problem.
>> >> Any ideas?
>> >>
>> >
>> > What photo looks like ? Is it serialazible ?
>> >
>> >
>>
>> Looking at [1], Photo seems to be a problematic pojo, it does not
>> properly provides getters and setters for all it's attributes, which
>> will cause issues for Tuscany/Jackson serialization/deserialization.
>>
>> My recommendation would be to put face4j on the side for couple mins,
>> define a independent set of service operations and required
>> information for these operations, and then for the implementation use
>> face4j. This would give us a clean Face Recognition Service interface,
>> and make the implementation much more flexible, as it would allow us
>> to change the implementation in the future as face4j would be
>> encapsulated in the service implementation.
>>
>>
>> [1]
>> https://github.com/mhendred/face4j/blob/master/face4j-core/src/main/java/com/github/mhendred/face4j/model/Photo.java
>>
>>
>> --
>> Luciano Resende
>> http://people.apache.org/~lresende
>> http://twitter.com/lresende1975
>> http://lresende.blogspot.com/
>>
>
>
>
> --
> Subash Chaturanga
> Department of Computer Science & Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog -  http://subashsdm.blogspot.com/
> Twitter - http://twitter.com/subash89
>
>
>


-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89

Re: Problem with interacting among two SCA services.

Posted by Subash Chaturanga <su...@gmail.com>.
Hi Luciano,
As you said, this is the suggestion to a refactored interface definition for
FaceRecognitionService interface.

public void train(String uids);
public void setFacebookOauth2(String fbUserId, String oauthToken);
public void  removeTags(String tids) ;
public void saveTags(String tids, String uid, String label);
public Photo recognizeFromFile(File file, String uids);
public Photo recognizeFromUrls(String urls, String uids);
public Photo detectFromFile(String file);
public Photo detectFromUrls(String urls);
public void clearTwitterCreds();
public void clearFacebookCreds();

These are the most frequently methods which is used and which can be used in
future in face apps. No need any return type from train method as we only
need a void from it. But in the impl of this, we need a class called "Photo"
which will behaves similar to org.face4j.Photo . Because in future face
apps, when need to call these methods separately, we need to pass an
instance of "Photo" which can keep "Faces" from detecting or recognizing
images.

Otherwise for the requirements of my two face apps, the above API can
further reduced and even can make this such that "Photo" is no need as a
return type. But in future one might need it for simplicity.
WDYT?

Thanks

On Mon, Aug 1, 2011 at 1:02 AM, Luciano Resende <lu...@gmail.com>wrote:

> On Tue, Jul 26, 2011 at 10:06 PM, Luciano Resende <lu...@gmail.com>
> wrote:
> > On Tue, Jul 26, 2011 at 9:23 PM, Subash Chaturanga <su...@gmail.com>
> wrote:
> >> FYI,
> >> When I change the return type to String it works fine. But currently I
> am
> >> returning a face4j.Photo. Seems returning the type Photo from one
> service
> >> method to its parent method in another service is the problem.
> >> Any ideas?
> >>
> >
> > What photo looks like ? Is it serialazible ?
> >
> >
>
> Looking at [1], Photo seems to be a problematic pojo, it does not
> properly provides getters and setters for all it's attributes, which
> will cause issues for Tuscany/Jackson serialization/deserialization.
>
> My recommendation would be to put face4j on the side for couple mins,
> define a independent set of service operations and required
> information for these operations, and then for the implementation use
> face4j. This would give us a clean Face Recognition Service interface,
> and make the implementation much more flexible, as it would allow us
> to change the implementation in the future as face4j would be
> encapsulated in the service implementation.
>
>
> [1]
> https://github.com/mhendred/face4j/blob/master/face4j-core/src/main/java/com/github/mhendred/face4j/model/Photo.java
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/
>



-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89

Re: Problem with interacting among two SCA services.

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Jul 26, 2011 at 10:06 PM, Luciano Resende <lu...@gmail.com> wrote:
> On Tue, Jul 26, 2011 at 9:23 PM, Subash Chaturanga <su...@gmail.com> wrote:
>> FYI,
>> When I change the return type to String it works fine. But currently I am
>> returning a face4j.Photo. Seems returning the type Photo from one service
>> method to its parent method in another service is the problem.
>> Any ideas?
>>
>
> What photo looks like ? Is it serialazible ?
>
>

Looking at [1], Photo seems to be a problematic pojo, it does not
properly provides getters and setters for all it's attributes, which
will cause issues for Tuscany/Jackson serialization/deserialization.

My recommendation would be to put face4j on the side for couple mins,
define a independent set of service operations and required
information for these operations, and then for the implementation use
face4j. This would give us a clean Face Recognition Service interface,
and make the implementation much more flexible, as it would allow us
to change the implementation in the future as face4j would be
encapsulated in the service implementation.


[1] https://github.com/mhendred/face4j/blob/master/face4j-core/src/main/java/com/github/mhendred/face4j/model/Photo.java


-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: Problem with interacting among two SCA services.

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Jul 26, 2011 at 9:23 PM, Subash Chaturanga <su...@gmail.com> wrote:
> FYI,
> When I change the return type to String it works fine. But currently I am
> returning a face4j.Photo. Seems returning the type Photo from one service
> method to its parent method in another service is the problem.
> Any ideas?
>

What photo looks like ? Is it serialazible ?



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: Problem with interacting among two SCA services.

Posted by Subash Chaturanga <su...@gmail.com>.
FYI,
When I change the return type to String it works fine. But currently I am
returning a face4j.Photo. Seems returning the type Photo from one service
method to its parent method in another service is the problem.
Any ideas?

On Wed, Jul 27, 2011 at 3:25 AM, Subash Chaturanga <su...@gmail.com>wrote:

> Hi all,
>
> I have an unexpected issues with my two services and I tried to resolve
> this many times, but couldn't figure out a way. I use FacebookFriendFinder
>  and FaceRecognitionService services. There, in FacebookFriendFinder impl, I
> use  basic methods in FaceRecognitionService. In one occasion I call a
> method  FaceRecognitionService.recognize() from  FacebookFriendFinder
> service it doesn't return the expected return values(checked the results
> with a pilot program).
>
> In other words here is the sequence of service method calls i did.
>
> 1. FacebookFriendFinder.findMyFriends() ----> calls method in line 2
> 2. FaceRecognitionService.recognize() -----> impl of FaceRecognitionService
> calls the face4j method as in line 3
> 3. face4j.DefaultClient.recognize() method.
>
> I am not getting return values ofrom line 1 method.  But when I see, inside
> the impl of FaceRecognitionService service, the corresponding method(method
> in line 3) returns the expected values. But those values doesn't goes up in
> the method hierarchy.
>
> I have updated the JIRA with a patch [1] with the latest patch where I got
> an unexpected issue with the services I created.
>
> So can anybody try this by adding adam's facebook credentials and face api
> keys to the patch [1].
> (after applying the patch and filling credentials params in service impl
> classes, go to gallery image and click on facebook button. It should give an
>  alert with some value (no of recognized faces)).
>
>
>
>
> [1] -
> https://issues.apache.org/jira/secure/attachment/12487900/issuesWithServices.patch
>
>
>
> --
> Subash Chaturanga
> Department of Computer Science & Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog -  http://subashsdm.blogspot.com/
> Twitter - http://twitter.com/subash89
>
>
>


-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89