Forum

Author Topic: alignCamera on MacBook(Corei5 2.3GHz) is much faster than AWS(Xeon 2.3GHz)  (Read 1436 times)

kaz

  • Newbie
  • *
  • Posts: 21
    • View Profile
Hello,

I'm running Metashape on MacBook Pro13-inch 2017 and AWS EC2 p2.xlarge ubuntu18.04 and noticed alignCamera on MBP(1sec) is much faster than on AWS(28sec) even though AWS seems to have similar or better CPU.
All CPU cores are utilized 100% during computation for AWS.
GPU computation is disabled.
Logs are attached.
I tried other EC2 instances(g3.4xlarge, p3.2xlarge, c5.2xlarge) but there were no large difference from p2.xlarge.

Do anyone know the reason of that and how to improve performance on AWS?

Specs:
CPUMEM
MBPCore i5-7360U 2.3 GHz dual core 16GB 2133 MHz LPDDR3
AWSXeon E5-2686 v4 2.3 GHz 4 cores61GB

Optimization become slower after line 124(log_aws.txt) on AWS.
Code: [Select]
111 adding camera 9 (10 of 25), 31 of 48 used
112 adding 48 points, 4 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
113 adjusting: xxxxxxxxxx 0.374631 -> 0.363007
114 adding 1 points, 0 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
115 adjusting: xxxxxxxxxx 0.383473 -> 0.379003
116 adding 0 points, 1 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
117 optimized in 0.05614 seconds
118 adding camera 10 (11 of 25), 43 of 53 used
119 adding 60 points, 3 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
120 adjusting: xxxxxxxxxx 0.377789 -> 0.368868
121 adding 1 points, 0 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
122 adjusting: xxxxxxxxx 0.369398 -> 0.369248
123 adding 0 points, 0 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
124 optimized in 1.16628 seconds
125 adding camera 11 (12 of 25), 40 of 44 used
126 adding camera 12 (13 of 25), 35 of 46 used
127 adding 109 points, 2 far (3 threshold), 0 inaccurate, 1 invisible, 0 weak
128 adjusting: xxxxxxxxxx 0.371148 -> 0.355195
129 adding 3 points, 0 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
130 adjusting: xxxxxxxx 0.356127 -> 0.355829
131 adding 0 points, 0 far (3 threshold), 0 inaccurate, 0 invisible, 0 weak
132 optimized in 1.34306 seconds

Code:
Code: [Select]
import time
from glob import glob
import Metashape

filenames = glob('./images/image*.JPG')

chunk = Metashape.Document().addChunk()
chunk.addPhotos(filenames)

start_time = time.time()
chunk.matchPhotos(accuracy=Metashape.LowAccuracy, generic_preselection=True, reference_preselection=False)
print('\n******************************\n')
print('matchPhotos: %d sec' % (time.time()-start_time))
print('\n******************************\n')

start_time = time.time()
chunk.alignCameras(adaptive_fitting=False)
print('\n******************************\n')
print('alignCameras: %d sec' % (time.time()-start_time))
print('\n******************************\n')

Any comment could be appreciated.

Thank you,
Kaz
« Last Edit: September 11, 2019, 09:27:23 AM by kaz »

kaz

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: alignCamera on MacBook(Corei5 2.3GHz) is much faster than AWS(Xeon 2.3GHz)
« Reply #1 on: September 11, 2019, 09:29:32 AM »
Additional information

I run the code with single CPU like "taksset -c 0 python3 test.py" on AWS.
Then computation time has been shortened from 28sec to 14sec.


Kaz
« Last Edit: September 11, 2019, 09:49:50 AM by kaz »