Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Upload folder using huggingface_hub
Browse files- README.md +3 -9
 - main.py +18 -0
 - requirements.txt +6 -0
 
    	
        README.md
    CHANGED
    
    | 
         @@ -1,12 +1,6 @@ 
     | 
|
| 1 | 
         
             
            ---
         
     | 
| 2 | 
         
            -
            title:  
     | 
| 3 | 
         
            -
             
     | 
| 4 | 
         
            -
            colorFrom: yellow
         
     | 
| 5 | 
         
            -
            colorTo: yellow
         
     | 
| 6 | 
         
             
            sdk: gradio
         
     | 
| 7 | 
         
            -
            sdk_version: 4. 
     | 
| 8 | 
         
            -
            app_file: app.py
         
     | 
| 9 | 
         
            -
            pinned: false
         
     | 
| 10 | 
         
             
            ---
         
     | 
| 11 | 
         
            -
             
     | 
| 12 | 
         
            -
            Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
         
     | 
| 
         | 
|
| 1 | 
         
             
            ---
         
     | 
| 2 | 
         
            +
            title: Skin_Cancer_Classifier
         
     | 
| 3 | 
         
            +
            app_file: main.py
         
     | 
| 
         | 
|
| 
         | 
|
| 4 | 
         
             
            sdk: gradio
         
     | 
| 5 | 
         
            +
            sdk_version: 4.25.0
         
     | 
| 
         | 
|
| 
         | 
|
| 6 | 
         
             
            ---
         
     | 
| 
         | 
|
| 
         | 
    	
        main.py
    ADDED
    
    | 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            import gradio as gr
         
     | 
| 2 | 
         
            +
            from transformers import pipeline
         
     | 
| 3 | 
         
            +
             
     | 
| 4 | 
         
            +
            pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
         
     | 
| 5 | 
         
            +
             
     | 
| 6 | 
         
            +
            def predict(input_img):
         
     | 
| 7 | 
         
            +
                predictions = pipeline(input_img)
         
     | 
| 8 | 
         
            +
                return input_img, {p["label"]: p["score"] for p in predictions} 
         
     | 
| 9 | 
         
            +
             
     | 
| 10 | 
         
            +
            gradio_app = gr.Interface(
         
     | 
| 11 | 
         
            +
                predict,
         
     | 
| 12 | 
         
            +
                inputs=gr.Image(label="Input Skin Image", sources=['upload', 'webcam'], type="pil"),
         
     | 
| 13 | 
         
            +
                outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
         
     | 
| 14 | 
         
            +
                title="How severe is my Skin Cancer?",
         
     | 
| 15 | 
         
            +
            )
         
     | 
| 16 | 
         
            +
             
     | 
| 17 | 
         
            +
            if __name__ == "__main__":
         
     | 
| 18 | 
         
            +
                gradio_app.launch()
         
     | 
    	
        requirements.txt
    ADDED
    
    | 
         @@ -0,0 +1,6 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            # Python 3.10.14
         
     | 
| 2 | 
         
            +
            gradio==4.25.0
         
     | 
| 3 | 
         
            +
            transformers==4.37.2
         
     | 
| 4 | 
         
            +
            torch
         
     | 
| 5 | 
         
            +
            numpy
         
     | 
| 6 | 
         
            +
            pillow==10.3.0
         
     |