Skip to content

Latest commit

 

History

History
 
 

Huawei_Ascend

HiFIll Image Inpainting on Ascend AI Processor (Python)

For implementation on recent CANN version, please refer to https://github.com/Ascend/samples/tree/master/python/level2_simple_inference/6_other/imageinpainting_hifill

Project Overview

This project is implementation of HiFill Image Inpainting on Atlas200DK board.

Application Deployment Steps

You can deploy this application on the Atlas 200 DK to inpaint on images with respective masks.

The current application adapts to DDK&RunTime of 1.32.0.0.

Prerequisites

Before deploying this sample, ensure that the development environment for Atlas200DK has been setup according to this guide, or with ADKInstaller, or with docker image

Software Preparation

Before running this application, download or git clone the whole repository to any directory on Ubuntu Server where Mind Studio is located, and copy samples folder to the directory of Huawei_Ascend.

Setup Python Environment on Atlas200DK Board

Note: If the HiAI library, OpenCV library, and related dependencies have been installed on the developer board, skip this step.

  1. Configure the network connection of the developer board.

    Configure the network connection of the Atlas DK developer board by referring to https://github.com/Atlas200dk/sample-README/tree/master/DK_NetworkConnect.

  2. Install the environment dependencies(please deploy in python3).

    Configure the environment dependency by referring to https://github.com/Atlas200dk/sample-README/tree/master/DK_Environment.

Deployment

Copy the application codes and samples to the developer board.

Go to the directory of 'Huawei_Ascend', and run the following command to copy the code and samples to the developer board.

scp -r ../Huawei_Ascend/ [email protected]:/home/HwHiAiUser/HIAI_PROJECTS

Type the password of the developer board as prompted. The default password is Mind@123.

Run

  1. Log in to the host side as the HwHiAiUser user in SSH mode on Ubuntu Server where Mind Studio is located.

    ssh [email protected]

    NOTE:

    • The following uses the USB connection mode as an example. In this case, the IP address is 192.168.1.2. Replace the IP address as required.
  2. Go to the directory where the application code is stored as the HwHiAiUser user.

  3. Run the application.

    python3 test_Dchip.py

Project Layout

Huawei_Ascend
├── ModelManager.py              # Graph creation and inference 
├── inpaint.om                   # Huawei Ascend Offline model for HiFill Image inpainting        
├── matmul.om                    # Huawei Ascend Offline model to accelerate matrix muliplication in postprocessing        
├── inpaint_inference.py         # inpainting graph
├── matmul_inference.py          # matmul graph
├── test_Dchip.py                # script to run the application