Discussions

Ask a Question

"Realm does not exist" from auth/realms/immersityai/protocol/openid-connect/token

Attempting to create an access token using client id and secret using Python example provided in docs. Getting this in response: ``` {'error': 'Realm does not exist'} ``` Is this an error in my code? The text of this error seems unfamiliar to me. Thanks in advance

Problems in disparity requests

Hello, I use your API via a Streamlit UI that I developed. I generate presigned URLs via Google, and I have been using your API frequently. Recently, I noticed changes in your documentation, and I encountered errors in disparity and animation requests. Therefore, I tried updating the request URLs to match those in the new documentation. I can successfully generate tokens using the following function: ``` # Função para obter o token de acesso LeiaPix def get_access_token(): IMMERSITYAI_LOGIN_OPENID_TOKEN_URL = ( "https://auth.immersity.ai/auth/realms/immersity/protocol/openid-connect/token" ) token_response = requests.post( IMMERSITYAI_LOGIN_OPENID_TOKEN_URL, data={ "client_id": YOUR_CLIENT_ID, "client_secret": YOUR_CLIENT_SECRET, "grant_type": "client_credentials", }, ).json() st.write(token_response) return token_response.get("access_token") ``` ``` ``` Unfortunately, when I try to generate disparity, I always get a timeout. I execute it as follows: ``` access_token = get_access_token() if access_token: # Gera URLs pré-assinadas para disparidade e animação correlation_id_disparity = str(uuid.uuid4()) disparity_blob_name = f"disparity_{correlation_id_disparity}.jpg" put_disparity_presigned_url = create_presigned_url_put(disparity_blob_name) print(f"Google Disparity URL: {put_disparity_presigned_url}") # Faz a chamada para a API da LeiaPix para disparidade disparity_response = requests.post( "https://api.immersity.ai/api/v1/disparity", headers={ "accept": "application/json", "content-type": "application/json", "Authorization": f"Bearer {access_token}" }, # Acquired in previous step json={ "correlationId": correlation_id_disparity, "inputImageUrl": image_url, # Link to the image you want to get disparity for "resultPresignedUrl": put_disparity_presigned_url, # Presigned URL with HTTP PUT permission. }, timeout=5*60, # expires in 5 min ) print(disparity_response.status_code, disparity_response.text) ``` I am trying to understand what I might be doing wrong. As I mentioned, it used to work perfectly in Leia. I also tried making a request via your documentation page (<https://docs-api.immersity.ai/reference/transactioncontroller_estimatemonodepth-1>), but I receive a 500 error with the request structured as follows: ``` import requests url = "https://api.immersity.ai/api/v1/disparity" payload = { "inputImageUrl": "https://super.abril.com.br/wp-content/uploads/2018/05/filhotes-de-cachorro-alcanc3a7am-o-c3a1pice-de-fofura-com-8-semanas1.png?quality=70&strip=all&resize=420" } headers = { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJVbDlpOTVQaVdhVXlsYmdQQVdZcERyS0NibWZhbUt3NnJWMk5jdWlwX09FIn0" } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` Response: ``` { "statusCode": 500, "message": "Internal server error" } ``` Could you please help me identify what might be causing these issues? Thank you.

Timeframe for the Video Processing API

Is there a timeline for a video processing api endpoint? Ie like the web portals 2d video to 3D.

Got 502 error on animation request

request curl --request POST --url <https://api.immersity.ai/api/v1/animation> --header 'accept: application/json' --header 'authorization: Bearer XXX' --header 'content-type: application/json' --data ' { "resultPresignedUrl": "<https://hook.eu2.make.com/9hpy34dcgqcgjqg4fpjr7i7hd8rwbj7p">, "inputDisparityUrl": "<https://www.dropbox.com/scl/fi/la8juafomypr4kxifk2tt/disparity_map-1.png?rlkey=59wovnl737x9rzgcegz96s3un&dl=1">, "inputImageUrl": "<https://sun9-8.userapi.com/impg/9dMKm7rtAd6Ut-it4DkxV6MOb68zT54GVsTfoQ/MbXjNgKAkQ0.jpg?size=810x1080&quality=95&sign=e116d8803261706a8a5de0535a0247d7&type=album">, "animationType": "mp4" } ' Got error after some minutes <html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> <hr><center>nginx</center> </body> </html> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page -->

Error getting access token

curl --request POST --url '<https://auth.immersity.ai/auth/realms/immersity/protocol/openid-connect/token'> --header 'accept: application/json' --header 'content-type: application/json' --data ' { "grant_type": "client_credentials", "client_id": "bd22b110-2b79-44a2-b2eb-e1e026dd68f8", "client_secret": "..." } ' Response: { "error": "RESTEASY003065: Cannot consume content type" } Why I got this error?

Hi i am running this code everyti me its generating its giving me an error for no reason , could you please tell me issue

import os import uuid import requests import json url = "<https://auth.leialoft.com/auth/realms/leialoft/protocol/openid-connect/token"> payload = { "grant_type": "client_credentials", "client_id": "", "client_secret": "" } headers = { "accept": "application/json", "content-type": "application/x-www-form-urlencoded" } response = requests.post(url, data=payload, headers=headers) # Parse the response JSON response_json = response.json() # Extract the access token access_token = response_json.get('access_token', 'Token not found') print(access_token) correlation_id = str(uuid.uuid4()) print(f'\\nGenerating Disparity with correlationId: {correlation_id}') MEDIA_CLOUD_REST_API_BASE_URL = '<https://api.leiapix.com'> ORIGINAL_IMAGE_URL = os.getenv('ORIGINAL_IMAGE_URL', '<https://images.pexels.com/photos/38771/pexels-photo-38771.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'>) THREE_MIN_IN_MS = 3 _ 60 \_ 1000 # Timeout for HTTP requests def main(): try: ```text print(f"\nLeiaLogin AccessToken acquired: {access_token}") correlation_id = str(uuid.uuid4()) print(f"\nGenerating Disparity with correlationId: {correlation_id}") headers = { 'Authorization': f'Bearer {access_token}' } payload = { 'correlationId': correlation_id, 'inputImageUrl': ORIGINAL_IMAGE_URL } response = requests.post(f"{MEDIA_CLOUD_REST_API_BASE_URL}/api/v1/disparity", json=payload, headers=headers, timeout=THREE_MIN_IN_MS / 1000) # Timeout needs to be in seconds # Check response status and handle potential issues response.raise_for_status() # Assuming the response is JSON and it includes a 'resultPresignedUrl' get_disparity_presigned_url = response.json().get('resultPresignedUrl') print(f'\nDisparity has been uploaded to the temporary storage. To view it, use this GET URL: {get_disparity_presigned_url}') except requests.exceptions.RequestException as e: print(f"Error. Unhandled exception: {e}") ``` ``` ``` if **name** == '**main**': main() import requests url_2 = "<https://api.leiapix.com/api/v1/animation"> payload = { "inputImageUrl": ORIGINAL_IMAGE_URL, "correlationId": correlation_id, "inputDisparityUrl": '<https://leia-storage-service-production.s3.us-east-1.amazonaws.com/timed/D001/1215623e-a16e-4b51-9d53-051efbc555ea/e5e3d5a3-a35d-4c2f-9f9e-5324f5f402ec/3ff2ab61-c67a-4616-a68c-c2292d62663b/9eb2c5f6-eedc-4d73-a182-33d3ec282fb8.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIASC7ECGJVHARKLZ6E%2F20240426%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240426T144007Z&X-Amz-Expires=86400&X-Amz-Signature=fbb91febf2db1d9bb84a4b76b21e965ab0f0c5b5a24ae4dda1067740e2acc037&X-Amz-SignedHeaders=host&x-id=GetObject'> , "animationType": "mp4", "pattern": "0.0", "animationLength": 3, "outputWidth": 500, "outputHeight": 450, "amplitudeX": 2, "amplitudeY": 2, "amplitudeZ": 2, "phaseX": 3, "phaseY": 3, "phaseZ": 3, "gain": 3, "convergence": 1, "numberOfLoops": 3 } headers = { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer {access_token}"} response = requests.post(url_2, json=payload, headers=headers) print(response.text) Output I am getting after running this is <br> eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhMWZUdW1mb1RXbGJENUtEN1ZLbF8xZmluREg0ZTBQTG9NOWMwQTl4WFpjIn0.eyJleHAiOjE3MTQxNDM0MzAsImlhdCI6MTcxNDE0MjUzMCwianRpIjoiNjVjZDYwMWYtMjc4Zi00ZjdjLTk4MzYtMTg1ZTRkYzhmNjdmIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmxlaWFsb2Z0LmNvbS9hdXRoL3JlYWxtcy9sZWlhbG9mdCIsInN1YiI6IjQ4MmMyODdjLTBiYjgtNDcyYi04NzZkLWM5ZjMxMDM0YTg1M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4MmMyODdjLTBiYjgtNDcyYi04NzZkLWM5ZjMxMDM0YTg1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImFjciI6IjEiLCJzY29wZSI6ImxlaWEtYXBpLWdhdGV3YXkiLCJjbGllbnRJZCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImNsaWVudC1vd25lci11c2VyLWlkIjoiMTIxNTYyM2UtYTE2ZS00YjUxLTlkNTMtMDUxZWZiYzU1NWVhIiwiY2xpZW50SG9zdCI6IjQ3LjkuMTQ2LjEzNyIsImNsaWVudEFkZHJlc3MiOiI0Ny45LjE0Ni4xMzcifQ.GAndbLsuTGO890eHTNjU8sFXVIg-XgFCr7IGwFs1EG8fcMl068gFPDD5cZh1wx3vtnr-xVroIvEqY7dwfqH9XaioApGi3U-XhAeWtqzSORvMxbxUIme7mBjDtBkeah7-JSVy_pGF1UyZw6WYV-QptJ3uV7K2xyPV0yD9oxvsT4B_VI8_MwjbDb07vi1AdBkVsbFHTB1VzLyZRrpW9Qlv8MJFz6P9EHtgfj2Q15u3MKat16KWT2ZU3fWifQ6caxyiuGARS9icwi5q3fxnp3n56jj-N0qafnKauGaF8_sz1FUiG0nB_X8aM6a2k7FUrVOyGz1YTwF0Vup1O83vatxxVA Generating Disparity with correlationId: 6b3688f8-4c16-4a06-b76e-64c2c890eaff Disparity has been uploaded to the temporary storage. To view it, use this GET URL: <https://leia-storage-service-production.s3.us-east-1.amazonaws.com/timed/D001/1215623e-a16e-4b51-9d53-051efbc555ea/e5e3d5a3-a35d-4c2f-9f9e-5324f5f402ec/9ba63a62-2f33-4293-bbd6-1e11ef968a38/d9e3d1cd-ff2a-45ac-9c16-8311226c29e7.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIASC7ECGJVHARKLZ6E%2F20240426%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240426T144213Z&X-Amz-Expires=86400&X-Amz-Signature=2867749af14fcc6e85b3b08b0dffea39107a5a99f7d61ecf23ef25f669ff4a0e&X-Amz-SignedHeaders=host&x-id=GetObject> {"statusCode":401,"message":"Unauthorized"} So why I am not able to genearate image after getting access token and every thing else .

I am doing same , what ever you have told iam still facing same issue

import requests url = "<https://api.leiapix.com/api/v1/disparity"> payload = { "correlationId": "d8f085ae-a562-408a-a2a6-2bee5fed64f0", "inputImageUrl": "<https://res.cloudinary.com/dv31jevup/image/upload/v1713788468/samples/woman-on-a-football-field.jpg">, "dilation": 0.01, "inputType": "image2d", "outputBitDepth": "uint8" } headers = { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhMWZUdW1mb1RXbGJENUtEN1ZLbF8xZmluREg0ZTBQTG9NOWMwQTl4WFpjIn0.eyJleHAiOjE3MTQxMzAyMjEsImlhdCI6MTcxNDEyOTMyMSwianRpIjoiZjJlMTEwODItMTQzNC00YmM1LWE2MjAtMzgzOGE2ZWIxNWI2IiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmxlaWFsb2Z0LmNvbS9hdXRoL3JlYWxtcy9sZWlhbG9mdCIsInN1YiI6IjQ4MmMyODdjLTBiYjgtNDcyYi04NzZkLWM5ZjMxMDM0YTg1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImFjciI6IjEiLCJzY29wZSI6ImxlaWEtYXBpLWdhdGV3YXkiLCJjbGllbnRJZCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImNsaWVudC1vd25lci11c2VyLWlkIjoiMTIxNTYyM2UtYTE2ZS00YjUxLTlkNTMtMDUxZWZiYzU1NWVhIiwiY2xpZW50SG9zdCI6IjQ3LjkuMTM3LjI0MiIsImNsaWVudEFkZHJlc3MiOiI0Ny45LjEzNy4yNDIifQ.LwsOMEoDMzzrKnrsHfeh71mu7J_9U2aBTCUw22e8tR-IQX-XaIzh_TauhtnPVczCL0-QvRttHJSwWweaPP0_WFk2GGoHyUwQ-Wu4rgTV7ud1T4G_c20KXVU384bNkePuLOUim991-crwk20YISpAK7TCJJvhszTVSg5fSQYCdxp_Bd49OTf02mIBiv6mvp0QRQPiODb-kExovyht8TVrWa5TaOyOubRoXaNbb2Ti4LXW5g9zuv2o9GjWUw54q1mchAIWjgS0yM8nNWhWMP30XR-vNnXPcCpR0AoQMWJlgeOhjMfkVpUABLLjsBHoEa0cMH6HsiqJqP2XjiIebkFgEw" } response = requests.post(url, json=payload, headers=headers) print(response.text)

I am not able to understand , What value should i put in authentication Bearer token .

I am using api to create animation , But u need to require disparity url to do it . But if I want to get url in animation I need to give some Authorisation bearer token in rght hand side box .What token should I provide in that box for authentication . I have already provided id, secret , access token . But simply that was not working import requests url = "<https://api.leiapix.com/api/v1/disparity"> payload = { "inputImageUrl": "<https://res.cloudinary.com/dv31jevup/image/upload/v1713788468/samples/woman-on-a-football-field.jpg">, "resultPresignedUrl": "<https://res.cloudinary.com/dv31jevup/image/upload/v1713788468/samples/woman-on-a-football-field.jpg">, "correlationId": "4f444d1a-c866-49fa-a540-edcb39c4fdef", "dilation": 0.01, "inputType": "image2d", "outputBitDepth": "uint8" } headers = { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer Bearer jeyJleHAiOjE3MTM3ODQzMDMsImlhdCI6MTcxMzc4MzQwMywianRpIoiMDU0OTA3NGUtYTQ2Ny00YjlmLWIxNDQtNzQ4NjhkMTlmOTdjIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmxlaWFsb2Z0LmNvbS9hdXRoL3JlYWxtcy9sZWlhbG9mdCIsInN1YiI6IjQ4MmMyODdjLTBiYjgtNDcyYi04NzZkLWM5ZjMxMDM0YTg1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImFjciI6IjEiLCJzY29wZSI6ImxlaWEtYXBpLWdhdGV3YXkiLCJjbGllbnRJZCI6IjIwNTY0YjlkLWFlZGItNDlkYy1iMTM2LTNjOWIxNTI2ZjMwYSIsImNsaWVudC1vd25lci11c2VyLWlkIjoiMTIxNTYyM2UtYTE2ZS00YjUxLTlkNTMtMDUxZWZiYzU1NWVhIiwiY2xpZW50SG9zdCI6IjQ0LjIzMy4xNTEuMjciLCJjbGllbnRBZGRyZXNzIjoiNDQuMjMzLjE1MS4yNyJ9" } response = requests.post(url, json=payload, headers=headers) print(response.text)