temporal network

utilities holding temporal network info

source

TempNet

 TempNet (image_pairs, check_if_valid=True)

Initialize self. See help(type(self)) for accurate signature.

Usage:

Create a temporal network by specifing the number of images and the temporal bandwidth (the maximum number of images to be paired with one image):

tnet = TempNet.from_bandwidth(5,2)
tnet.image_pairs
array([[0, 1],
       [0, 2],
       [1, 2],
       [1, 3],
       [2, 3],
       [2, 4],
       [3, 4]], dtype=int32)

Or, you can specify your own image pairs:

tnet = TempNet(np.stack(([0,1,2,3],[1,2,3,4]),axis=-1))
tnet.image_pairs
array([[0, 1],
       [1, 2],
       [2, 3],
       [3, 4]], dtype=int32)
tnet.image_pairs_idx(ref=1,sec=2)
1
tnet.image_pairs_idx(ref=[1,2],sec=[2,3])
array([1, 2])

source

nimage_from_npair

 nimage_from_npair (npair)

infer number of images from number of pairs assuming all pairs are selected.

nimage_from_npair(6)
4