|
@@ -148,8 +148,10 @@ class AiView(View):
|
|
if AiServiceQuery[0]['orders__payType'] == 10: # AI首次体验前半个月调Rekognition
|
|
if AiServiceQuery[0]['orders__payType'] == 10: # AI首次体验前半个月调Rekognition
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
add_time = AiServiceQuery[0]['addTime']
|
|
add_time = AiServiceQuery[0]['addTime']
|
|
- if (now_time - add_time) <= (3600 * 24 * 3):
|
|
|
|
|
|
+ if (now_time - add_time) <= (3600 * 24 * 2):
|
|
ai_server = 'rekognition'
|
|
ai_server = 'rekognition'
|
|
|
|
+ elif (now_time - add_time) <= (3600 * 24 * 3):
|
|
|
|
+ ai_server = 'novaLite'
|
|
|
|
|
|
APP_NOTIFY_KEY = f'ASJ:NOTIFY:PUSH:{uid}:{channel}' # 推送间隔缓存KEY
|
|
APP_NOTIFY_KEY = f'ASJ:NOTIFY:PUSH:{uid}:{channel}' # 推送间隔缓存KEY
|
|
push_cache_data = redis_obj.get_data(APP_NOTIFY_KEY)
|
|
push_cache_data = redis_obj.get_data(APP_NOTIFY_KEY)
|
|
@@ -159,9 +161,9 @@ class AiView(View):
|
|
|
|
|
|
# APP推送提醒状态
|
|
# APP推送提醒状态
|
|
notify = self.is_ai_push(uid, notify_data) if is_push else is_push
|
|
notify = self.is_ai_push(uid, notify_data) if is_push else is_push
|
|
- nova_key = f'PUSH:NOVA:LITE:{uid}'
|
|
|
|
- nova = redis_obj.get_data(nova_key)
|
|
|
|
- if nova: # AWS AI模型
|
|
|
|
|
|
+ # nova_key = f'PUSH:NOVA:LITE:{uid}'
|
|
|
|
+ # nova = redis_obj.get_data(nova_key)
|
|
|
|
+ if ai_server == 'novaLite': # AWS AI模型
|
|
sage_maker = SageMakerAiObject()
|
|
sage_maker = SageMakerAiObject()
|
|
|
|
|
|
# AI nova识别异步存表&推送
|
|
# AI nova识别异步存表&推送
|
|
@@ -279,8 +281,8 @@ class AiView(View):
|
|
|
|
|
|
client = boto3.client(
|
|
client = boto3.client(
|
|
'rekognition',
|
|
'rekognition',
|
|
- aws_access_key_id='AKIA2E67UIMD6JD6TN3J',
|
|
|
|
- aws_secret_access_key='6YaziO3aodyNUeaayaF8pK9BxHp/GvbbtdrOAI83',
|
|
|
|
|
|
+ aws_access_key_id=AWS_ACCESS_KEY_ID[1],
|
|
|
|
+ aws_secret_access_key=AWS_SECRET_ACCESS_KEY[1],
|
|
region_name='us-east-1')
|
|
region_name='us-east-1')
|
|
# 执行AWS Rekognition:
|
|
# 执行AWS Rekognition:
|
|
rekognition_res = client.detect_labels(
|
|
rekognition_res = client.detect_labels(
|