コード例 #1
0
    def test_process_single_image(self):
        self.save_picture()
        mood_service = MoodService()
        mood_process = mood_service.perfom_mood_detection("12345")
        mood_process_get = mood_service.get_mood("12345")

        self.assertEqual(1, len(mood_process.faces))
        self.assertEqual(1, len(mood_process_get.faces))
        self.assertEqual(mood_process.faces[0].mood, mood_process_get.faces[0].mood)
コード例 #2
0
    def test_process_single_image(self):
        self.save_picture()
        mood_service = MoodService()
        mood_process = mood_service.perfom_mood_detection("12345")
        mood_process_get = mood_service.get_mood("12345")

        self.assertEqual(1, len(mood_process.faces))
        self.assertEqual(1, len(mood_process_get.faces))
        self.assertEqual(mood_process.faces[0].mood,
                         mood_process_get.faces[0].mood)
コード例 #3
0
ファイル: app.py プロジェクト: andrespires/mood-detector
class Mood(Resource):
    def __init__(self):
        self.mood_service = MoodService()

    def get(self, uid):
        mood_process = self.mood_service.get_mood(uid)
        return mood_process.to_json()

    def put(self, uid):
        mood_process = self.mood_service.perfom_mood_detection(uid)
        return mood_process.to_json()
コード例 #4
0
ファイル: app.py プロジェクト: andrespires/mood-detector
class Mood(Resource):

    def __init__(self):
        self.mood_service = MoodService()

    def get(self, uid):
        mood_process = self.mood_service.get_mood(uid)
        return mood_process.to_json()

    def put(self, uid):
        mood_process = self.mood_service.perfom_mood_detection(uid)
        return mood_process.to_json()
コード例 #5
0
ファイル: app.py プロジェクト: andrespires/mood-detector
 def __init__(self):
     self.mood_service = MoodService()
コード例 #6
0
    def test_get_mood_process(self):
        self.save_picture()

        mood_service = MoodService()
        mood_process = mood_service.get_mood("12345")
        self.assertEqual(2, len(mood_process.faces))
コード例 #7
0
    def test_get_mood_process(self):
        self.save_picture()

        mood_service = MoodService()
        mood_process = mood_service.get_mood("12345")
        self.assertEqual(2, len(mood_process.faces))
コード例 #8
0
ファイル: app.py プロジェクト: andrespires/mood-detector
 def __init__(self):
     self.mood_service = MoodService()