Forum

Author Topic: Need help with AI Masking code (Python )  (Read 20914 times)

rbhurtha

  • Newbie
  • *
  • Posts: 7
    • View Profile
Need help with AI Masking code (Python )
« on: July 28, 2025, 01:42:30 PM »
Dear all,

When trying to generate automatic masks using AI, I am getting this error:

ERROR: Can't open file: The system cannot find the file specified (2): {filename}_mask.png

I would appreciate if anyone could help please.

I am using Metashape Pro 2.2.1

Attached is the python code.

Any help is much appreciated.

Regards
Roshan









rbhurtha

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Need help with AI Masking code (Python )
« Reply #1 on: July 28, 2025, 02:27:43 PM »
I resolved it. It's simply the json file for the AI model.

path = 'C:/Users/rb200/AppData/Local/Agisoft/Metashape Pro/ai/default/U2Net_v1.json'

Many thanks
Roshan