Persons

Get All Persons From Project

Request Sample

const result = await mediaviz.person.getAllPersonsFromProject('<PROJECT_TABLE_NAME>');
import type { PhotoPersonWithS3Link } from '@mediaviz/sdk';

const result: PhotoPersonWithS3Link[] = await mediaviz.person.getAllPersonsFromProject('<PROJECT_TABLE_NAME>');
const result = await mediaviz.person.getAllPersonsFromProject('<PROJECT_TABLE_NAME>');
const { client } = useMediaViz();

const result = await client.person.getAllPersonsFromProject('<PROJECT_TABLE_NAME>');
result = mediaviz.person.get_all_persons_from_project('<PROJECT_TABLE_NAME>')
$result = $mediaviz->person->getAllPersonsFromProject('<PROJECT_TABLE_NAME>');
curl -X GET 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

[
  {
    "id": 0,
    "person_id": "string",
    "bounding_box": {},
    "confidence": 0.0,
    "person_name": "string",
    "photo_s3_link": "https://example.com/..."
  }
]

Get All Person Names From Project

Returns each distinct name in the collection, wrapped in an array. Persons without a name are not included.

Request Sample

const result = await mediaviz.person.getAllPersonNamesFromProject('<PROJECT_TABLE_NAME>');
const result = await mediaviz.person.getAllPersonNamesFromProject('<PROJECT_TABLE_NAME>');
const result = await mediaviz.person.getAllPersonNamesFromProject('<PROJECT_TABLE_NAME>');
const { client } = useMediaViz();

const result = await client.person.getAllPersonNamesFromProject('<PROJECT_TABLE_NAME>');
result = mediaviz.person.get_all_person_names_from_project('<PROJECT_TABLE_NAME>')
$result = $mediaviz->person->getAllPersonNamesFromProject('<PROJECT_TABLE_NAME>');
curl -X GET 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/names' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

[
  [
    "Jane Smith"
  ],
  [
    "John Doe"
  ]
]

Get All Persons From Photo

Request Sample

const result = await mediaviz.person.getAllPersonsFromPhoto('<PROJECT_TABLE_NAME>', '<PHOTO_ID>');
import type { PhotoPersonLight } from '@mediaviz/sdk';

const result: PhotoPersonLight[] = await mediaviz.person.getAllPersonsFromPhoto('<PROJECT_TABLE_NAME>', '<PHOTO_ID>');
const result = await mediaviz.person.getAllPersonsFromPhoto('<PROJECT_TABLE_NAME>', '<PHOTO_ID>');
const { client } = useMediaViz();

const result = await client.person.getAllPersonsFromPhoto('<PROJECT_TABLE_NAME>', '<PHOTO_ID>');
result = mediaviz.person.get_all_persons_from_photo('<PROJECT_TABLE_NAME>', '<PHOTO_ID>')
$result = $mediaviz->person->getAllPersonsFromPhoto('<PROJECT_TABLE_NAME>', '<PHOTO_ID>');
curl -X GET 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/photo/<PHOTO_ID>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

[
  {
    "id": 0,
    "person_id": "string",
    "bounding_box": {},
    "confidence": 0.0,
    "person_name": "string"
  }
]

Get Photo Ids By Persons

Returns the IDs of photos that include all of the requested persons. For example, passing two person IDs returns only photos where both appear. At least one person_id is required.

Request Sample

const result = await mediaviz.person.getPhotoIdsByPersons(
  '<PROJECT_TABLE_NAME>',
  {
    personId: '<PERSON_ID>'
  }
);
const result = await mediaviz.person.getPhotoIdsByPersons(
  '<PROJECT_TABLE_NAME>',
  {
    personId: '<PERSON_ID>'
  }
);
const result = await mediaviz.person.getPhotoIdsByPersons(
  '<PROJECT_TABLE_NAME>',
  {
    personId: '<PERSON_ID>'
  }
);
const { client } = useMediaViz();

const result = await client.person.getPhotoIdsByPersons(
  '<PROJECT_TABLE_NAME>',
  {
    personId: '<PERSON_ID>'
  }
);
result = mediaviz.person.get_photo_ids_by_persons('<PROJECT_TABLE_NAME>', person_id='<PERSON_ID>')
$result = $mediaviz->person->getPhotoIdsByPersons(
  '<PROJECT_TABLE_NAME>',
  [
    'personId' => '<PERSON_ID>'
  ]
);
curl -X GET 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/photos' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

[
  1035601,
  1035604
]

Update Person

Renames a person everywhere they appear in the collection. Renaming to a name another person already has fails with 400; to merge the two, use Combine Persons instead.

Request Sample

const result = await mediaviz.person.updatePerson(
  '<PROJECT_TABLE_NAME>',
  '<PERSON_ID>',
  {
    personName: '<PERSON_NAME>'
  }
);
const result = await mediaviz.person.updatePerson(
  '<PROJECT_TABLE_NAME>',
  '<PERSON_ID>',
  {
    personName: '<PERSON_NAME>'
  }
);
const result = await mediaviz.person.updatePerson(
  '<PROJECT_TABLE_NAME>',
  '<PERSON_ID>',
  {
    personName: '<PERSON_NAME>'
  }
);
const { client } = useMediaViz();

const result = await client.person.updatePerson(
  '<PROJECT_TABLE_NAME>',
  '<PERSON_ID>',
  {
    personName: '<PERSON_NAME>'
  }
);
result = mediaviz.person.update_person(
    '<PROJECT_TABLE_NAME>',
    '<PERSON_ID>',
    person_name='<PERSON_NAME>'
)
$result = $mediaviz->person->updatePerson(
  '<PROJECT_TABLE_NAME>',
  '<PERSON_ID>',
  [
    'personName' => '<PERSON_NAME>'
  ]
);
curl -X PUT 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/<PERSON_ID>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

[
  "Jane Smith"
]

Remove Person Name

Resets the person's name to its default, Person N, where N comes from the person ID (e.g. person_3_project_... becomes Person 3).

Request Sample

const result = await mediaviz.person.removePersonName('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
import type { PhotoPersonLight } from '@mediaviz/sdk';

const result: PhotoPersonLight = await mediaviz.person.removePersonName('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
const result = await mediaviz.person.removePersonName('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
const { client } = useMediaViz();

const result = await client.person.removePersonName('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
result = mediaviz.person.remove_person_name('<PROJECT_TABLE_NAME>', '<PERSON_ID>')
$result = $mediaviz->person->removePersonName('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
curl -X PUT 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/remove_name/<PERSON_ID>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

{
  "id": 0,
  "person_id": "string",
  "bounding_box": {},
  "confidence": 0.0,
  "person_name": "string"
}

Combine Persons

Merges old_person_id into destination_person_id: every appearance of the old person takes the destination person's ID and name. The two IDs must be different.

Request Sample

const result = await mediaviz.person.combinePersons(
  '<PROJECT_TABLE_NAME>',
  '<DESTINATION_PERSON_ID>',
  '<OLD_PERSON_ID>'
);
import type { PhotoPersonLight } from '@mediaviz/sdk';

const result: PhotoPersonLight = await mediaviz.person.combinePersons(
  '<PROJECT_TABLE_NAME>',
  '<DESTINATION_PERSON_ID>',
  '<OLD_PERSON_ID>'
);
const result = await mediaviz.person.combinePersons(
  '<PROJECT_TABLE_NAME>',
  '<DESTINATION_PERSON_ID>',
  '<OLD_PERSON_ID>'
);
const { client } = useMediaViz();

const result = await client.person.combinePersons(
  '<PROJECT_TABLE_NAME>',
  '<DESTINATION_PERSON_ID>',
  '<OLD_PERSON_ID>'
);
result = mediaviz.person.combine_persons(
    '<PROJECT_TABLE_NAME>',
    '<DESTINATION_PERSON_ID>',
    '<OLD_PERSON_ID>'
)
$result = $mediaviz->person->combinePersons(
  '<PROJECT_TABLE_NAME>',
  '<DESTINATION_PERSON_ID>',
  '<OLD_PERSON_ID>'
);
curl -X PUT 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/combine/<DESTINATION_PERSON_ID>/<OLD_PERSON_ID>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

{
  "id": 0,
  "person_id": "string",
  "bounding_box": {},
  "confidence": 0.0,
  "person_name": "string"
}

Split Persons

Reassigns one face, identified by its instance id from Get All Persons From Photo. Pass new_name to turn the face into a new person, or destination_person_id to assign it to an existing person. Pass one or the other, not both.

Request Sample

const result = await mediaviz.person.splitPersons(
  '<PROJECT_TABLE_NAME>',
  '<ID>',
  {
    newName: '<NEW_NAME>',
    destinationPersonId: '<DESTINATION_PERSON_ID>'
  }
);
import type { PhotoPersonLight } from '@mediaviz/sdk';

const result: PhotoPersonLight = await mediaviz.person.splitPersons(
  '<PROJECT_TABLE_NAME>',
  '<ID>',
  {
    newName: '<NEW_NAME>',
    destinationPersonId: '<DESTINATION_PERSON_ID>'
  }
);
const result = await mediaviz.person.splitPersons(
  '<PROJECT_TABLE_NAME>',
  '<ID>',
  {
    newName: '<NEW_NAME>',
    destinationPersonId: '<DESTINATION_PERSON_ID>'
  }
);
const { client } = useMediaViz();

const result = await client.person.splitPersons(
  '<PROJECT_TABLE_NAME>',
  '<ID>',
  {
    newName: '<NEW_NAME>',
    destinationPersonId: '<DESTINATION_PERSON_ID>'
  }
);
result = mediaviz.person.split_persons(
    '<PROJECT_TABLE_NAME>',
    '<ID>',
    new_name='<NEW_NAME>',
    destination_person_id='<DESTINATION_PERSON_ID>'
)
$result = $mediaviz->person->splitPersons(
  '<PROJECT_TABLE_NAME>',
  '<ID>',
  [
    'newName' => '<NEW_NAME>',
    'destinationPersonId' => '<DESTINATION_PERSON_ID>'
  ]
);
curl -X PUT 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/split/<ID>/' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

{
  "id": 0,
  "person_id": "string",
  "bounding_box": {},
  "confidence": 0.0,
  "person_name": "string"
}

Remove Person

Removes the person from every photo they appear in. The photos themselves are not deleted.

Request Sample

const result = await mediaviz.person.removePerson('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
const result = await mediaviz.person.removePerson('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
const result = await mediaviz.person.removePerson('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
const { client } = useMediaViz();

const result = await client.person.removePerson('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
result = mediaviz.person.remove_person('<PROJECT_TABLE_NAME>', '<PERSON_ID>')
$result = $mediaviz->person->removePerson('<PROJECT_TABLE_NAME>', '<PERSON_ID>');
curl -X DELETE 'https://api.mediaviz.ai/api/v1/person/<PROJECT_TABLE_NAME>/<PERSON_ID>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzAxYWJjMTIzIiwiZXhwIjoxNzQzNjMwMzI5fQ.RwJF-KLLr8K5JgEtIeFiKWELcv-FDLNzMPHJ2St_wAo'

Response Sample

{
  "ok": true,
  "message": "Removed person person_3_project_z-photos-1024-a1b2c3d4 from 4 photo(s)."
}