Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MetaUser555

Pages: [1]
1
Python and Java API / Import model script help
« on: October 18, 2024, 11:39:52 PM »
Hello there,
I have this script

import Metashape
import os

# Access the current project document
doc = Metashape.app.document

# Get the project folder and construct the export path
project_folder = doc.path
export_folder = os.path.join(project_folder, "..", "export")

# Loop through all chunks in the project
for chunk in doc.chunks:
    # Construct the model path using the chunk label
    model_path = os.path.join(export_folder, f"{chunk.label}.abc")
    model_format = Metashape.ModelFormatABC

    # Import the model into the current chunk
    chunk.importModel(model_path, format=model_format)

it runs but gives me an error, saying:
2024-10-18 16:33:45 ImportModel: path = N:/Projects/projectFiles/model.psx\..\export\model.abc, format = ModelFormatABC
2024-10-18 16:33:45 Finished processing in 0.001 sec (exit code 0)
2024-10-18 16:33:45 Traceback (most recent call last):
2024-10-18 16:33:45   File "X:/metashape/impmod.py", line 18, in <module>
2024-10-18 16:33:45     chunk.importModel(model_path, format=model_format)
2024-10-18 16:33:45 Exception: IArchive::IArchive( iFileName )
2024-10-18 16:33:45 ERROR: EXCEPTION:
2024-10-18 16:33:45 Could not open as Ogawa file: N:/Projects/projectFiles/model.psx\..\export\model.abc
2024-10-18 16:33:45 Error: IArchive::IArchive( iFileName )
2024-10-18 16:33:45 ERROR: EXCEPTION:
2024-10-18 16:33:45 Could not open as Ogawa file: N:/Projects/projectFiles/model.psx\..\export\model.abc


can you tell me what I'm doing wrong?
cheers

2
General / Batch commands in UI for Pathing
« on: June 15, 2023, 07:18:54 PM »
Hi there,
I'm putting this into the Path section of the batch ui
{projectpath}/export/{chunklabel}.abc
was expecting just the project path but when it's run i get:
Error: Can't make path: The filename, directory name, or volume label syntax is incorrect (123):
it's appending the correct path from above with this:
C:/Users/me/Desktop/
is there something I'm missing in the batch command?
Metashape Pro 2.0.1
thanks for your help

3
General / batch saving frames
« on: February 03, 2023, 02:14:45 AM »
{frame} using this in my batch export the numbering goes from 1. Is there a way to pad this out so it starts with a defined amount of characters so we could start at 0001 from the batch?

4
General / 16bit images in - 8bit texture out?
« on: September 20, 2019, 12:19:43 AM »
Hi, just wanted to know if there is a way to force an image to export as an 8bit tif even if you have the model built with 16bit images.
There doesn't seem to be any option to select bit depth.
I'm trying to reduce file sizes and I don't need a 16bit image as the exported texture file - I'm using RAW files as the processing images from a dslr.
thanks for any help!

5
Python and Java API / Script to increase region by 2x
« on: August 16, 2019, 12:22:18 AM »
Hi,
I was looking for a simple python script to increase the size of the region by 2x so i'm not cutting off any part of the model during the dense cloud process
I've looked on the forum but all seem to be pretty specific to their own needs, just looking for a simplified version
Thanks for any help!

6
General / obj corrupted on export
« on: December 02, 2017, 01:24:02 AM »
Hi,
I'm getting an issue when exporting a model [see pic]
i'm running the beta 1.4.0.5432 but I don't think that's the issue in this case as other models have exported fine.
I have a vague recollection of someone having this problem before but I can't find it on the forums
I've tried rebuilding the mesh several times but to no avail, I've also tried on three separate machines [with different nvidia GPUs] with their own version of Agi Pro.
As you can see in the pic the 3d mesh is fine in agi but when i import it to ZBrush, 3DMax or Meshlab it comes in corrupted.
The only difference in this scan was i went from a low sparse cloud to medium dense cloud to 'high' face count poly model.
Thanks for any help

7
Python and Java API / Rotate Region by a specific angle
« on: October 13, 2015, 09:53:26 PM »
Hi,
I'm new to python and i'm trying to rotate my region by a specified angle.
I'm stuck on how to do this with my limited python skills!
would someone steer me in the right direction?
Here's what i have at the moment - i seem to be able to reset my region (now commented out) but not rotate it.
Ideally i want to rotate in a direction by 90 degrees.
thanks for your help!

Code: [Select]
import PhotoScan
import math

doc = PhotoScan.app.document
chunk = doc.chunks[0]
reg = chunk.region

#<---- Rotation ---- i've put random numbers in here>
reg.rot = PhotoScan.Matrix( [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] ).t

#chunk.resetRegion()


print (reg.rot)
print (doc.chunks[0])

8
General / PSX file not saving as expected
« on: October 02, 2015, 06:51:13 PM »
Hi,
Hope you could shed some light on this problem i'm having.

I'm working with PSX files so i can network my processing to other machines.

I'll send off scan saved as a psx and do an align photos + optimize cameras. This is using 40 pics which are masked [I have to apply the masks manually without networking which is another subject]

I'll load it up when its done and get rid of rouge points and do some gradual selection on the sparse cloud.

The problem comes when i try to save over the psx with my changes and send it out to the other machines to work on.
The changes I make do not save into the psx file when i 'save' or even 'save as' over the original file.
If i do this it will just revert to the original sparse cloud.

The only way i can get the changes is to delete the save file and 'chunk' file and save a fresh psx.
Is there a good reason why i cant save over the original data?

thanks for your help

9
General / Quick question on scale
« on: July 07, 2015, 11:21:53 PM »
Hi,
I sometimes get a very small mesh from an agisoft scan.
Is there a way, in agisoft, to scale the mesh up.
I've already got processes to do this outside of agi but i just wanted to know if i'm missing a trick inside of agisoft itself.
Thanks for your help.

10
General / performance drop from multiple titan X's
« on: June 16, 2015, 06:18:56 PM »
Hi,
I've been benchmark testing setups with multi GPUs
I have 3 Titan X's in a PC i'm going from 1 to 2 to 3 gpus with the same scene.
i'm getting diminishing returns as i add GPUs on performance - I was wondering if i have an obvious [to you] bottleneck somewhere in my system that is causing this or is it just what happens?
All drivers are up to date and running windows 7 enterprise
SLI is enabled but i believe it's bypasses this as we're using open CL

edit:
The scene is identical in each case
It's the dense cloud process from a saved pre-processed align photos scene
the machine is restarted before each test

1 GPU:
OpenCL  active CPU cores 15/16
Device 1 performance: 202.403 million samples/sec (CPU)
Device 2 performance: 1142.96 million samples/sec (GeForce GTX TITAN X)

2 GPUs
OpenCL  active CPU cores 14/16
Device 1 performance: 174.528 million samples/sec (CPU)
Device 2 performance: 718.264 million samples/sec (GeForce GTX TITAN X)
Device 3 performance: 754.264 million samples/sec (GeForce GTX TITAN X)

3 GPUs
OpenCL  active CPU cores 13/16
Device 1 performance: 197.528 million samples/sec (CPU)
Device 2 performance: 469.848 million samples/sec (GeForce GTX TITAN X)
Device 3 performance: 491.990 million samples/sec (GeForce GTX TITAN X)
Device 3 performance: 493.464 million samples/sec (GeForce GTX TITAN X)

Processor: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz (16 CPUs), ~3.0GHz
Memory: 32768MB RAM

any helpful advice or comments much appreciated!
thanks

11
Feature Requests / Batch Processing Refinement
« on: January 14, 2015, 06:42:12 PM »
Without python API support for networking, would you be able to make the batch processing a bit more flexible?
I like the features you have added in the latest version but a few more features which would be very useful are:
-saving the batch [huge!]
-or at least remembering your last selections when opening another  version of agi not just going back to the standard default
-load photos from a folder
-auto save using the path from the photos
-having the defaults reflect whats going on in the main ui [eg in the ui i have "use masks" in align photos]
-reset region feature when optimizing alignment

Thanks

Pages: [1]