MCPcopy Create free account
hub / github.com/VisionRush/DeepFakeDefenders / test

Method test

main_infer.py:118–132  ·  view source on GitHub ↗
(self, img_path)

Source from the content-addressed store, hash-verified

116 return images_copied
117
118 def test(self, img_path):
119 # img load
120 img_data = Image.open(img_path).convert('RGB')
121
122 # transform
123 all_data = []
124 for transform in self.transformer_:
125 current_data = transform(img_data)
126 current_data = self.add_new_channels(current_data)
127 all_data.append(current_data)
128 img_tensor = torch.stack(all_data, dim=0).unsqueeze(0).cuda()
129
130 preds = self.model(img_tensor)
131
132 return round(float(preds), 20)
133
134
135def main():

Callers 2

mainFunction · 0.95
inter_apiFunction · 0.95

Calls 1

add_new_channelsMethod · 0.95

Tested by

no test coverage detected