> For the complete documentation index, see [llms.txt](https://facegsm.gitbook.io/facegsm-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://facegsm.gitbook.io/facegsm-documentation/facegsm/usage/capture-mode.md).

# Capture Mode

## Description

**Capture mode** integrates with a third party application called [**Droidcam**](https://play.google.com/store/apps/details?id=com.dev47apps.droidcam\&hl=en) to get images of both the **attacker** and the **victim** from the user's camera. FaceGSM then performs targeted adversarial attack based on previous captured photos.

<figure><img src="/files/kq89YVkNOekA4SygPunn" alt=""><figcaption><p>Capture Mode Program Flow </p></figcaption></figure>

## How To

1. Install [**Droidcam**](https://play.google.com/store/apps/details?id=com.dev47apps.droidcam\&hl=en) on your Android device and copy the **Droidcam IP address** (this IP address would be used as host for camera input).

<figure><img src="/files/6h5GN0gRDkDxWdkBG9vo" alt="" width="563"><figcaption><p>Droidcam IP Address</p></figcaption></figure>

2. Run `facegsm.py capture --target ./path/to/target.png --host [Droidcam IP Address]`
3. Place the camera pointed to the `attacker's` face and press the `Capture Original` button
4. Start the attacking process by pressing the `Attack` button, the adversarial image will be saved in `outputs` folder

## Example

```bash
$ python3 facegsm.py capture --target ./victims/bob.png --host https://127.0.0.1:4747/video
```

## Demo

A demonstration of the capture mode can be seen here: [FaceGSM Capture Mode Demo](https://binusianorg-my.sharepoint.com/personal/clintswood_binus_ac_id/_layouts/15/guestaccess.aspx?share=EUgdIg1fl5FPrzSo3e5L6G0BSDgkEdT9OAT2QMUsG-h0sw\&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJPbmVEcml2ZUZvckJ1c2luZXNzIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXciLCJyZWZlcnJhbFZpZXciOiJNeUZpbGVzTGlua0NvcHkifX0\&e=1Ls1eM)
