ff98 commited on
Commit
8d6a8db
·
2 Parent(s): 041cde8 8cd3992

Merge remote-tracking branch 'refs/remotes/origin/main'

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +18 -18
README.md CHANGED
@@ -33,7 +33,7 @@ https://huggingface.co/spaces/Digital-Detectives/AI-vs-Real-Image-Detection
33
 
34
  ## UI
35
 
36
- https://github.com/user-attachments/assets/7d6a3c38-f7dc-4e74-8f0d-6d31653e7670
37
 
38
  ## Project Outline
39
  The goal of this project is to develop a deep learning model that can accurately distinguish between real images and AI-generated images. We will collect datasets of real images and fake images. The data will be preprocessed, normalized, and augmented to enhance training. Using TensorFlow and Keras, we will design a Convolutional Neural Network (CNN) for classification, and validating performance through a confusion matrix. Finally, the project will include documentation of the process, findings, and suggestions for future improvements.
 
33
 
34
  ## UI
35
 
36
+ <video controls autoplay src="https://cdn-uploads.huggingface.co/production/uploads/671fc13a4b2e5a664a9d3137/ZSo6v5V3QK-ip-PPHW_be.mp4"></video>
37
 
38
  ## Project Outline
39
  The goal of this project is to develop a deep learning model that can accurately distinguish between real images and AI-generated images. We will collect datasets of real images and fake images. The data will be preprocessed, normalized, and augmented to enhance training. Using TensorFlow and Keras, we will design a Convolutional Neural Network (CNN) for classification, and validating performance through a confusion matrix. Finally, the project will include documentation of the process, findings, and suggestions for future improvements.
app.py CHANGED
@@ -74,28 +74,28 @@ def run_cnn(img_arr):
74
 
75
  # efficientnet model
76
  def run_effNet(img_arr):
77
- try:
78
- resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
79
- tf.config.experimental_connect_to_cluster(resolver)
80
- tf.tpu.experimental.initialize_tpu_system(resolver)
81
- strategy = tf.distribute.TPUStrategy(resolver)
82
- except ValueError:
83
- strategy = tf.distribute.get_strategy()
84
- with strategy.scope():
85
- prediction = eff_net_model.predict(img_arr)
86
  return prediction
87
 
88
  # efficientnet art model
89
  def run_effNet_Art(img_arr):
90
- try:
91
- resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
92
- tf.config.experimental_connect_to_cluster(resolver)
93
- tf.tpu.experimental.initialize_tpu_system(resolver)
94
- strategy = tf.distribute.TPUStrategy(resolver)
95
- except ValueError:
96
- strategy = tf.distribute.get_strategy()
97
- with strategy.scope():
98
- prediction = eff_net_art_model.predict(img_arr)
99
  return prediction
100
 
101
  # preprocess images for efficient net
 
74
 
75
  # efficientnet model
76
  def run_effNet(img_arr):
77
+ # try:
78
+ # resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
79
+ # tf.config.experimental_connect_to_cluster(resolver)
80
+ # tf.tpu.experimental.initialize_tpu_system(resolver)
81
+ # strategy = tf.distribute.TPUStrategy(resolver)
82
+ # except ValueError:
83
+ # strategy = tf.distribute.get_strategy()
84
+ # with strategy.scope():
85
+ prediction = eff_net_model.predict(img_arr)
86
  return prediction
87
 
88
  # efficientnet art model
89
  def run_effNet_Art(img_arr):
90
+ # try:
91
+ # resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
92
+ # tf.config.experimental_connect_to_cluster(resolver)
93
+ # tf.tpu.experimental.initialize_tpu_system(resolver)
94
+ # strategy = tf.distribute.TPUStrategy(resolver)
95
+ # except ValueError:
96
+ # strategy = tf.distribute.get_strategy()
97
+ # with strategy.scope():
98
+ prediction = eff_net_art_model.predict(img_arr)
99
  return prediction
100
 
101
  # preprocess images for efficient net