コード例 #1
0
ファイル: infer.py プロジェクト: handar423/CoorDL
def build(seg_num=8, target_size=224):
    image_shape = [seg_num, 3, target_size, target_size]

    image = fluid.layers.data(name='image', shape=image_shape, dtype='float32')

    model = TSM()
    return model(image)
コード例 #2
0
ファイル: bracket.py プロジェクト: jsm-txt/CS1.1-OPPChallange
    def create_team(self):
        '''Prompt user for team'''

        team_name = input("Team's name: ")
        tsmteam = True
        while tsmteam == True:
            response = input("Is this a tsm team? (y/n) ")
            if response == "y":
                team = TSM(team_name)
                x = 0
                while x > 2:
                    player = self.create_player()
                    team.add_player(player)
                    x += 1
                return team
            else:
                tsmteam = False

        team = Team(team_name)
        x = 0
        while x > 2:
            player = self.create_player()
            team.add_player(player)
            x += 1
        return team
コード例 #3
0
def make_tsm(settings):
    non_local = settings["model_type"].endswith("-nl")
    return TSM(
        class_count,
        settings["segment_count"],
        settings["modality"],
        base_model=settings["arch"],
        new_length=settings["flow_length"]
        if settings["modality"] == "Flow" else 1,
        consensus_type="avg",
        dropout=settings["dropout"],
        shift_div=settings["shift_div"],
        shift_place=settings["shift_place"],
        temporal_pool=settings["temporal_pool"],
        non_local=non_local,
    )