Giter VIP home page Giter VIP logo

Comments (1)

ChinaYi avatar ChinaYi commented on September 7, 2024

Each test operation will call reset() function, see

batch_gen_tst.reset()

where reset function will call random() function, which results different randomness even started with the same seed.

ASFormer/batch_gen.py

Lines 21 to 47 in 3940443

def reset(self):
self.index = 0
self.my_shuffle()
def has_next(self):
if self.index < len(self.list_of_examples):
return True
return False
def read_data(self, vid_list_file):
file_ptr = open(vid_list_file, 'r')
self.list_of_examples = file_ptr.read().split('\n')[:-1]
file_ptr.close()
self.gts = [self.gt_path + vid for vid in self.list_of_examples]
self.features = [self.features_path + vid.split('.')[0] + '.npy' for vid in self.list_of_examples]
self.my_shuffle()
def my_shuffle(self):
# shuffle list_of_examples, gts, features with the same order
randnum = random.randint(0, 100)
random.seed(randnum)
random.shuffle(self.list_of_examples)
random.seed(randnum)
random.shuffle(self.gts)
random.seed(randnum)
random.shuffle(self.features)

from asformer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.