source/human-seg/src/human_seg_app.py [15:35]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def lambda_handler(event, context):
    if 'body' not in event:
        return {
            'statusCode': 200,
            'headers': {
                'Access-Control-Allow-Headers': '*',
                'Access-Control-Allow-Origin': '*',
                'Access-Control-Allow-Methods': '*'
            }
        }
    if isinstance(event['body'], str):
        body = json.loads(event['body'])
    else:
        body = event['body']
    if 'url' in body:
        uri = body['url']
        base64_image = Base64Image.from_uri(uri)
    else:
        base64_image = Base64Image.from_base64_image_string(body['img'])

    pil_image = base64_image.get_pil_image()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/porn-image/src/porn_image_app.py [26:47]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def lambda_handler(event, context):
    if 'body' not in event:
        return {
            'statusCode': 200,
            'headers': {
                'Access-Control-Allow-Headers': '*',
                'Access-Control-Allow-Origin': '*',
                'Access-Control-Allow-Methods': '*'
            }
        }
    if isinstance(event['body'], str):
        body = json.loads(event['body'])
    else:
        body = event['body']

    if 'url' in body:
        uri = body['url']
        base64_image = Base64Image.from_uri(uri)
    else:
        base64_image = Base64Image.from_base64_image_string(body['img'])

    pil_image = base64_image.get_pil_image()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



